Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action triggered on closed PR does not seem to find the PR number correctly #15

Open
spkane opened this issue Jan 5, 2022 · 4 comments

Comments

@spkane
Copy link

spkane commented Jan 5, 2022

I am using this in a job that triggers when a PR is closed:

on:
  pull_request:
    types: [closed]

like this:

      - name: Detect Pull Request
        uses: jwalton/gh-find-current-pr@v1
        id: findPr
        with:
          state: all

but later, when I use this:

        env:
          PR_NUM: ${{ steps.findPr.outputs.pr }}

That value is empty...

@spkane
Copy link
Author

spkane commented Jan 5, 2022

I initially was using

      - name: Detect Pull Request
        uses: jwalton/gh-find-current-pr@v1
        id: findPr
        with:
          state: closed

But that did not work any differently.

@spkane
Copy link
Author

spkane commented Jan 5, 2022

So, in my use case it turns out that simply using:

        env:
          PR_NUM: ${{ github.event.pull_request.number }}

instead of this action works as expected.

@cesarcelism
Copy link

the same issue with state input.. simply doesn't get the PR number when closed event happen

@Crisfole
Copy link

I think this action should short circuit if the github.event.pull_request.number is present... then just use octokit to fetch that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants