Skip to content

Commit 2419797

Browse files
committed
[TASK] Use simplier and working checkout ref determination
With the introduction of non-main branch scheduled workflow execution a adjusted checkout part in the `ci.yml` workflow file has been added to allow to define which branch should be checked out. That breaks pipeline execution for pull-requests opened from repository forks. This change replaces the old detection with a more simplified implementation, only setting the custom ref in case of github workflow_dispatch event execution using `''` as fallback which allows custom branch selection for workflow dispatching while keeping default repostiory and branch checkout intact. Releases: main, 8, 7
1 parent 2df1e91 commit 2419797

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@ jobs:
1515
php: [ '8.1' , '8.2', '8.3', '8.4']
1616
steps:
1717

18-
- name: Extract branch name
19-
shell: bash
20-
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
21-
id: extract_branch
22-
23-
- name: Checkout ${{ steps.extract_branch.outputs.branch }}
18+
- name: Checkout ${{ github.event_name == 'workflow_dispatch' && github.head_ref || '' }}
2419
uses: actions/checkout@v4
2520
with:
26-
ref: ${{ steps.extract_branch.outputs.branch }}
21+
ref: ${{ github.event_name == 'workflow_dispatch' && github.head_ref || '' }}
2722

2823
- name: Composer install
2924
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerUpdate

0 commit comments

Comments
 (0)