Skip to content

Commit

Permalink
Merge pull request #116 from bdo/issue-115
Browse files Browse the repository at this point in the history
fix: Upgrade to node 20
  • Loading branch information
jwalton authored Jan 27, 2024
2 parents 15e7a49 + 23342e2 commit ac8d0e3
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 101 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ This action tries to figure out the current PR.

If the event is a `pull_request`, it's very easy to get the current PR number
from the context via `${{ github.event.number }}`, but unfortunately this
information does not seem to be readily available for a `push` event. This
information does not seem to be readily available for a `push` event. This
action sends a request to GitHub to find the PR associated with the current SHA,
and returns its number in the `number` output. `number` will be an empty string if there is no
PR.

Additionally, `title` and `body` outputs are available as well to get the respective title and body of the PR.

By default, `gh-find-current-pr` will only return open PRs. You can pass in a
By default, `gh-find-current-pr` will only return open PRs. You can pass in a
`state` parameter to pick "open", "closed", or "all" PRs.

## Usage

```yaml
steps:
- uses: actions/checkout@v1
# Find the PR associated with this push, if there is one.
- uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
# Can be "open", "closed", or "all". Defaults to "open".
state: open
# This will echo "Your PR is 7", or be skipped if there is no current PR.
- run: echo "Your PR is ${PR}"
if: success() && steps.findPr.outputs.number
env:
PR: ${{ steps.findPr.outputs.pr }}
steps:
- uses: actions/checkout@v4
# Find the PR associated with this push, if there is one.
- uses: jwalton/gh-find-current-pr@master
id: findPr
with:
# Can be "open", "closed", or "all". Defaults to "open".
state: open
# This will echo "Your PR is 7", or be skipped if there is no current PR.
- run: echo "Your PR is ${PR}"
if: success() && steps.findPr.outputs.number
env:
PR: ${{ steps.findPr.outputs.pr }}
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ outputs:
body:
description: The PR's body if the PR was found
runs:
using: node16
using: node20
main: 'dist/index.js'
branding:
icon: git-pull-request
Expand Down
Loading

0 comments on commit ac8d0e3

Please sign in to comment.