Skip to content

Commit

Permalink
[TASK] Use simplier and working checkout ref determination
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sbuerk committed Nov 11, 2024
1 parent fa0c812 commit f468aad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ jobs:
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
steps:
- name: Checkout

- name: Checkout ${{ github.event_name == 'workflow_dispatch' && github.head_ref || '' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.head_ref || '' }}

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

0 comments on commit f468aad

Please sign in to comment.