Skip to content

Commit

Permalink
Update README.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha authored Sep 4, 2024
1 parent 91a68ff commit 399ed5e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ references: []

# How to use this project
usage: |-
### By SHA
The action allows getting PR info by `id` or `sha.`
`id` has precedence over `sha`. It will seek for PR by `sha` only if `id` input is empty.
### By ID
```yaml
on:
push:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
jobs:
pr:
Expand All @@ -50,6 +54,8 @@ usage: |-
steps:
- uses: cloudposse-github-actions/get-pr@main
id: pr
with:
id: ${{ github.event.number }}
outputs:
base: ${{ fromJSON(steps.pr.outputs.pr).base.sha }}
head: ${{ fromJSON(steps.pr.outputs.pr).head.sha }}
Expand All @@ -65,15 +71,13 @@ usage: |-
labels: ${{ steps.pr.outputs.labels }}
```
### By ID
### By SHA
```yaml
on:
pull_request:
push:
branches:
- main
types: [opened, synchronize, reopened]
jobs:
pr:
Expand All @@ -82,8 +86,6 @@ usage: |-
steps:
- uses: cloudposse-github-actions/get-pr@main
id: pr
with:
id: ${{ github.event.number }}
outputs:
base: ${{ fromJSON(steps.pr.outputs.pr).base.sha }}
head: ${{ fromJSON(steps.pr.outputs.pr).head.sha }}
Expand Down

0 comments on commit 399ed5e

Please sign in to comment.