A GitHub Action for finding pull requests.
Find a file
Julian Gruber 33d46d4ff9
1.11.0
2026-03-06 17:53:40 +01:00
.github/workflows run ci on pull requests 2024-03-24 16:12:01 +01:00
dist #55 'indicate multiple matching pull requests' (#56) 2026-03-06 17:52:47 +01:00
.gitignore chore: git should ignore files created by JetBrains IDEs (#12) 2020-09-04 22:13:53 +02:00
action.yml #55 'indicate multiple matching pull requests' (#56) 2026-03-06 17:52:47 +01:00
index.js #55 'indicate multiple matching pull requests' (#56) 2026-03-06 17:52:47 +01:00
package-lock.json 1.11.0 2026-03-06 17:53:40 +01:00
package.json 1.11.0 2026-03-06 17:53:40 +01:00
README.md #55 'indicate multiple matching pull requests' (#56) 2026-03-06 17:52:47 +01:00

find-pull-request-action

A GitHub Action for finding pull requests.

Usage

steps:
  - name: Find Pull Request
    uses: juliangruber/find-pull-request-action@v1
    id: find-pull-request
    with:
      branch: my-branch-name
  - run: echo "Pull Request ${number} (${sha})"
    env:
      number: ${{ steps.find-pull-request.outputs.number }}
      sha: ${{ steps.find-pull-request.outputs.head-sha }}

Authentication inputs:

  • github-token - PAT or GitHub Actions token

Query pull requests based on these inputs:

  • branch
  • base
  • author
  • state
  • repo
  • sort
  • direction
  • labels

For the first matching pull request, these outputs will be set:

  • number
  • title
  • url
  • head-ref
  • head-sha
  • base-ref
  • base-sha
  • base-repo
  • state
  • author

Meta outputs:

  • matching-pr-count - the number of matching pull requests
  • matching-pr-numbers - JSON array of matching pull request numbers

See action.yml for more details.

License

MIT