[AAE-32905] Fix commit messages commands aren't working (#11922)

* [ci:force] - Checking

* [AAE-32905] - Re enabled ci commands on commit messages

* [ci:force] - Checking
This commit is contained in:
Vito Albano
2026-06-01 09:47:45 +01:00
committed by GitHub
parent 80e9e51cfa
commit d206d28f1c
3 changed files with 38 additions and 7 deletions
+15 -3
View File
@@ -25,10 +25,22 @@ runs:
- name: affected:* flag parser
shell: bash
if: ${{ contains(github.event.head_commit.message , '[affected:*]') }}
env:
EVENT_NAME: ${{ github.event_name }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
echo "Setting up CI to run with commit flag [affected:*] flag."
echo "BREAK_ACTION=true" >> $GITHUB_ENV
# Get commit message safely from git to avoid script injection
# For PRs, use the PR head SHA; for other events use HEAD
if [ "$EVENT_NAME" == "pull_request" ] && [ -n "$PR_HEAD_SHA" ]; then
COMMIT_MSG=$(git log -1 --format=%B "$PR_HEAD_SHA" 2>/dev/null || echo "")
else
COMMIT_MSG=$(git log -1 --format=%B 2>/dev/null || echo "")
fi
if echo "$COMMIT_MSG" | grep -qF "[affected:*]"; then
echo "Setting up CI to run with commit flag [affected:*] flag."
echo "BREAK_ACTION=true" >> $GITHUB_ENV
fi
- name: PULL_REQUEST event
if: ${{ env.BREAK_ACTION == false && github.event_name == 'pull_request' && !github.event.pull_request.merged }}