Skip to content

Commit b784401

Browse files
authored
Skip commit message suggestions for PRs from forked repositories (#2093)
Because such workflow runs will fail due to unavailability of the relevant secrets. Working around this is nontrivial and a likely source of security issues.
1 parent a8bade5 commit b784401

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/suggest-commit-message.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ env:
2929
registry.npmjs.org:443
3030
jobs:
3131
suggest:
32+
# No commit message is suggested for code originating from forked
33+
# repositories, as such workflow runs do not have access to the requisite
34+
# secrets.
35+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
3236
permissions:
3337
contents: read
3438
pull-requests: write

0 commit comments

Comments
 (0)