Skip to content

Commit c648a36

Browse files
committed
doc(example): set permissions and only post on pr
Update the example so it only attempts to post comments on the PR action and set the permissions fields to the minimum values required to leave comments on PRs. Signed-off-by: Randolph Sapp <rs@ti.com>
1 parent 8dd06d6 commit c648a36

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,25 @@ on:
2323
jobs:
2424
commit-check:
2525
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
issues: write
29+
pull-requests: write
2630
steps:
2731
- uses: actions/checkout@v4
2832
with:
2933
ref: ${{ github.event.pull_request.head.sha }} # Checkout PR HEAD commit
3034
- uses: commit-check/commit-check-action@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3137
with:
3238
message: true
3339
branch: true
3440
author-name: true
3541
author-email: true
3642
commit-signoff: true
37-
dry-run: true
3843
job-summary: true
39-
pr-comments: true
44+
pr-comments: ${{ github.event_name == 'pull_request' }}
4045
```
4146
4247
## Optional Inputs

0 commit comments

Comments
 (0)