File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,20 @@ permissions:
66 issues : write
77
88on :
9- pull_request :
9+ pull_request_target :
1010 types : [opened, edited, synchronize]
1111
1212jobs :
1313 commitlint :
1414 runs-on : ubuntu-latest
15+ # Security: Only run on events we trust (not from untrusted forks doing malicious things)
16+ if : github.event_name == 'pull_request_target' && github.event.action != 'closed'
1517 steps :
1618 - name : Checkout code
1719 uses : actions/checkout@v4
1820 with :
21+ # For pull_request_target, we need to explicitly checkout the PR head
22+ ref : ${{ github.event.pull_request.head.sha }}
1923 fetch-depth : 0
2024
2125 - name : Setup Node.js
9094 - \`feat(cli)!:\` or \`BREAKING CHANGE:\` → MAJOR release (2.0.0)
9195 - \`fix(shared):\` → No CLI release (affects shared module only)
9296
93- ### 💡 Pro Tip
94- Run \`./commit-helper.sh\` to get scope suggestions based on your changed files!
95-
9697 Please update your commits and push again. Thank you! 🙏`;
9798
9899 await github.rest.issues.createComment({
@@ -128,5 +129,4 @@ jobs:
128129 echo "2. Follow the format: \`<type>(<scope>): <description>\`" >> $GITHUB_STEP_SUMMARY
129130 echo "3. Run \`./commit-helper.sh\` for scope suggestions" >> $GITHUB_STEP_SUMMARY
130131 echo "" >> $GITHUB_STEP_SUMMARY
131- echo "📖 See [CONVENTIONAL_COMMITS_GUIDE.md](./CONVENTIONAL_COMMITS_GUIDE.md) for details" >> $GITHUB_STEP_SUMMARY
132132 exit 1
You can’t perform that action at this time.
0 commit comments