diff options
| author | nessita <124304+nessita@users.noreply.github.com> | 2025-07-16 15:36:33 -0300 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2025-07-16 15:38:07 -0300 |
| commit | 591b23a11b099081fc39d00171f5dc9efbd67e13 (patch) | |
| tree | dfb0128a394f053451aff4c7c6b8c9aa66ddda17 /.github | |
| parent | 0c9ab357b7559a1676ace17e469848739b525d79 (diff) | |
[4.2.x] Fixed GitHub Action that checks commit prefixes to fetch PR head correctly.
Backport of 8499fba0e18826a77fe32cbc13a3d951d9ca8924 from main.
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/check_commit_messages.yml (renamed from .github/workflows/check-commit-messages.yml) | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/.github/workflows/check-commit-messages.yml b/.github/workflows/check_commit_messages.yml index c7c7bd0760..ee9536f482 100644 --- a/.github/workflows/check-commit-messages.yml +++ b/.github/workflows/check_commit_messages.yml @@ -19,9 +19,7 @@ jobs: id: vars run: | BASE="${{ github.event.pull_request.base.ref }}" - HEAD="${{ github.event.pull_request.head.ref }}" echo "BASE=$BASE" >> $GITHUB_ENV - echo "HEAD=$HEAD" >> $GITHUB_ENV VERSION="${BASE#stable/}" echo "prefix=[$VERSION]" >> $GITHUB_OUTPUT @@ -35,15 +33,15 @@ jobs: fi echo "✅ PR title has the required prefix." - - name: Fetch base and head branches + - name: Fetch relevant branches run: | - git fetch origin $BASE - git fetch origin $HEAD + git fetch origin $BASE:base + git fetch origin pull/${{ github.event.pull_request.number }}/head:pr - name: Check commit messages prefix run: | PREFIX="${{ steps.vars.outputs.prefix }}" - COMMITS=$(git rev-list origin/${BASE}..origin/${HEAD}) + COMMITS=$(git rev-list base..pr) echo "Checking commit messages for required prefix: $PREFIX" FAIL=0 for SHA in $COMMITS; do |
