Skip to content

Commit c28a0e3

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 45eebd7 commit c28a0e3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ jobs:
1414
matrix:
1515
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
1616
steps:
17-
- name: Extract branch name
18-
shell: bash
19-
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
20-
id: extract_branch
2117

22-
- name: Checkout ${{ steps.extract_branch.outputs.branch }}
18+
- name: Checkout ${{ github.event_name == 'workflow_dispatch' && github.head_ref || '' }}
2319
uses: actions/checkout@v4
2420
with:
25-
ref: ${{ steps.extract_branch.outputs.branch }}
21+
ref: ${{ github.event_name == 'workflow_dispatch' && github.head_ref || '' }}
2622

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

0 commit comments

Comments
 (0)