Skip to content

Commit 482a7a0

Browse files
committed
Revert "🐛 fix: checkout PR head SHA for issue_comment triggered workflows (llm-d#832)"
This reverts commit e69a146.
1 parent 76468de commit 482a7a0

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

.github/workflows/ci-pr-checks.yaml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
pull-requests: read # For reading PR details when triggered via issue_comment
5353
outputs:
5454
has_code_changes: ${{ steps.set-output.outputs.has_code_changes }}
55-
pr_head_sha: ${{ steps.pr-info.outputs.pr_head_sha }}
5655
steps:
5756
- name: Get PR number for issue_comment events
5857
id: pr-info
@@ -109,10 +108,7 @@ jobs:
109108
echo "has_code_changes=true" >> $GITHUB_OUTPUT
110109
fi
111110
112-
# lint-and-test already runs on pull_request events; skip for issue_comment
113-
# to avoid untrusted commenters triggering execution of PR code
114111
lint-and-test:
115-
if: github.event_name != 'issue_comment'
116112
runs-on: ubuntu-latest
117113
steps:
118114
- name: Checkout source
@@ -254,32 +250,13 @@ jobs:
254250
e2e-tests:
255251
runs-on: ubuntu-latest
256252
needs: [lint-and-test, check-code-changes, check-full-tests]
257-
if: >-
258-
always() && (
259-
(github.event_name == 'issue_comment' && needs.check-full-tests.outputs.run_full == 'true' && needs.check-code-changes.result == 'success') ||
260-
(github.event_name == 'workflow_dispatch' && (
261-
needs.check-full-tests.outputs.run_full == 'true' ||
262-
(needs.check-code-changes.result == 'success' && needs.check-code-changes.outputs.has_code_changes == 'true')
263-
)) ||
264-
(github.event_name == 'pull_request' && needs.check-code-changes.result == 'success' && needs.check-code-changes.outputs.has_code_changes == 'true')
265-
)
253+
if: always() && (needs.check-full-tests.outputs.run_full == 'true' || (needs.check-code-changes.result == 'success' && needs.check-code-changes.outputs.has_code_changes == 'true'))
266254
timeout-minutes: 60
267255
permissions:
268256
contents: read
269257
steps:
270-
- name: Validate PR head SHA for issue_comment events
271-
if: github.event_name == 'issue_comment'
272-
run: |
273-
if [ -z "${{ needs.check-code-changes.outputs.pr_head_sha }}" ]; then
274-
echo "::error::pr_head_sha is empty — refusing to fall back to main"
275-
exit 1
276-
fi
277-
echo "Checkout will use PR head SHA: ${{ needs.check-code-changes.outputs.pr_head_sha }}"
278-
279258
- name: Checkout source
280259
uses: actions/checkout@v4
281-
with:
282-
ref: ${{ needs.check-code-changes.outputs.pr_head_sha || '' }}
283260

284261
- name: Extract Go version from go.mod
285262
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV

0 commit comments

Comments
 (0)