We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b43a710 commit 3381c8dCopy full SHA for 3381c8d
.github/workflows/gen-preview.yml
@@ -23,7 +23,17 @@ jobs:
23
steps:
24
- name: Check conditions
25
id: check
26
+ env:
27
+ HEAD_REPO: ${{ github.event.workflow_run.head_repository.full_name }}
28
+ BASE_REPO: ${{ github.repository }}
29
run: |
30
+ # Security: Skip if workflow run is from a fork (untrusted code)
31
+ if [[ "$HEAD_REPO" != "$BASE_REPO" ]]; then
32
+ echo "::notice::Skipping: Workflow run is from fork '$HEAD_REPO', not '$BASE_REPO'"
33
+ echo "should_run=false" >> $GITHUB_OUTPUT
34
+ exit 0
35
+ fi
36
+
37
CONCLUSION="${{ github.event.workflow_run.conclusion }}"
38
39
if [[ "$CONCLUSION" != "success" ]]; then
0 commit comments