Skip to content

Commit f7bceb8

Browse files
committed
do not run workflow on forks
1 parent d25367f commit f7bceb8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/upload-dev-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
(
2424
github.event_name == 'workflow_run' &&
2525
github.event.workflow_run.event == 'pull_request' &&
26-
github.event.workflow_run.conclusion == 'success'
26+
github.event.workflow_run.conclusion == 'success' &&
27+
# Only trigger for branches in the main repo, not forks
28+
github.event.workflow_run.head_repository.full_name == github.repository
2729
)
2830
steps:
2931
- name: Get required metadata (PR number, commit SHA, workflow run ID containing artifacts)
@@ -49,7 +51,7 @@ jobs:
4951
exit 1
5052
fi
5153
52-
# If PR_NUM is empty (this is the case for forks) get PR number using SHA
54+
# If PR_NUM is empty, get PR number using SHA
5355
if [ -z "${PR_NUM}" ]; then
5456
PR_NUM=$(gh pr list --search "sha:${SHA}" --state open --json number --jq '.[0].number')
5557
fi

0 commit comments

Comments
 (0)