gh-find-current-pr icon indicating copy to clipboard operation
gh-find-current-pr copied to clipboard

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

Open spkane opened this issue 4 years ago • 4 comments

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 avatar Jan 05 '22 22:01 spkane

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 avatar Jan 05 '22 22:01 spkane

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.

spkane avatar Jan 05 '22 22:01 spkane

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

cesarcelism avatar Jun 16 '22 15:06 cesarcelism

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

Crisfole avatar Sep 29 '23 16:09 Crisfole