-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: use gh pr checkout to handle fork PRs in license-check workflow #1709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,8 +25,12 @@ jobs: | |
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.head_ref }} | ||
|
|
||
| # Check out the actual PR branch so we can push changes back if needed | ||
| - name: Check out PR branch | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: gh pr checkout ${{ github.event.pull_request.number }} | ||
|
Comment on lines
+30
to
+33
|
||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment on line 29 accurately describes the purpose of this step. However, it could be more specific about the scenarios this handles. Consider expanding it to:
"Check out the actual PR branch so we can push changes back if needed. This uses 'gh pr checkout' which properly handles both same-repo and fork PRs, unlike the previous 'ref: github.head_ref' approach which fails for fork PRs."
This provides better context for future maintainers about why this approach was chosen.