@@ -14,32 +14,66 @@ jobs:
1414 - name : Determine Mutation Run Parameters
1515 id : set_params
1616 shell : bash
17+ env :
18+ EVENT_NAME : ${{ github.event_name }}
19+ REF_NAME : ${{ github.ref_name }}
20+ PR_BASE_REF : ${{ github.event.pull_request.base.ref }}
21+ PR_TITLE : ${{ github.event.pull_request.title }}
22+ PR_BODY : ${{ github.event.pull_request.body }}
23+ COMMIT_MESSAGES_JOINED_WITH_SPACES_ACTIONS : ${{ join(github.event.commits.*.message, ' ') }}
24+ COMMIT_MESSAGES_JOINED_WITH_SLASHES_ACTIONS : ${{ join(github.event.commits.*.message, ' // ') }}
25+
1726 run : |
1827 echo "--- Debug: Determining mutation run parameters for pricing ---"
19- echo "Event name: ${{ github.event_name }}"
20- echo "Ref name: ${{ github.ref_name }}"
21- echo "Base ref (for PR): ${{ github.event.pull_request.base.ref }}"
22- echo "PR title: ${{ github.event.pull_request.title }}"
23- COMMIT_MESSAGES_LOG=$(echo "${{ join(github.event.commits.*.message, ' // ') }}" | head -c 500)
24- echo "Commit messages in push (first 500 chars): ${COMMIT_MESSAGES_LOG}..."
25- CONTAINS_MUTATE_FULL_IN_PUSH=$([[ "${{ contains(join(github.event.commits.*.message, ' '), '[mutate-full]') }}" == "true" ]] && echo "true" || echo "false")
26- echo "Contains '[mutate-full]' in push commit messages: $CONTAINS_MUTATE_FULL_IN_PUSH"
27- CONTAINS_MUTATE_FULL_IN_PR_TITLE=$([[ "${{ contains(github.event.pull_request.title, '[mutate-full]') }}" == "true" ]] && echo "true" || echo "false")
28- echo "Contains '[mutate-full]' in PR title: $CONTAINS_MUTATE_FULL_IN_PR_TITLE"
29- CONTAINS_MUTATE_FULL_IN_PR_BODY=$([[ "${{ contains(github.event.pull_request.body, '[mutate-full]') }}" == "true" ]] && echo "true" || echo "false")
30- echo "Contains '[mutate-full]' in PR body: $CONTAINS_MUTATE_FULL_IN_PR_BODY"
28+ echo "Event name: $EVENT_NAME"
29+ echo "Ref name: $REF_NAME"
30+ echo "Base ref (for PR): $PR_BASE_REF"
31+ echo "PR title: $PR_TITLE"
32+
33+ RAW_COMMIT_MESSAGES_FOR_JOIN_WITH_SLASHES="$COMMIT_MESSAGES_JOINED_WITH_SLASHES_ACTIONS"
34+ RAW_COMMIT_MESSAGES_FOR_JOIN_WITH_SPACES="$COMMIT_MESSAGES_FOR_JOIN_WITH_SPACES_ACTIONS"
35+
36+ CLEANED_COMMIT_MESSAGES_FOR_LOG="${RAW_COMMIT_MESSAGES_FOR_JOIN_WITH_SLASHES//\'/}"
37+ COMMIT_MESSAGES_LOG=$(echo "${CLEANED_COMMIT_MESSAGES_FOR_LOG}" | head -c 500)
38+ echo "Commit messages in push (cleaned, first 500 chars): ${COMMIT_MESSAGES_LOG}..."
39+
40+ CLEANED_COMMIT_MESSAGES_FOR_CONTAINS="${RAW_COMMIT_MESSAGES_FOR_JOIN_WITH_SPACES//\'/}"
41+
42+ if [[ "${CLEANED_COMMIT_MESSAGES_FOR_CONTAINS}" == *"[mutate-full]"* ]]; then
43+ CONTAINS_MUTATE_FULL_IN_PUSH="true"
44+ else
45+ CONTAINS_MUTATE_FULL_IN_PUSH="false"
46+ fi
47+ echo "Contains '[mutate-full]' in push commit messages (from cleaned messages): $CONTAINS_MUTATE_FULL_IN_PUSH"
48+
49+ CLEANED_PR_TITLE="${PR_TITLE//\'/}"
50+ if [[ "${CLEANED_PR_TITLE}" == *"[mutate-full]"* ]]; then
51+ CONTAINS_MUTATE_FULL_IN_PR_TITLE="true"
52+ else
53+ CONTAINS_MUTATE_FULL_IN_PR_TITLE="false"
54+ fi
55+ echo "Contains '[mutate-full]' in PR title (from cleaned title): $CONTAINS_MUTATE_FULL_IN_PR_TITLE"
56+
57+ CLEANED_PR_BODY="${PR_BODY//\'/}"
58+ if [[ "${CLEANED_PR_BODY}" == *"[mutate-full]"* ]]; then
59+ CONTAINS_MUTATE_FULL_IN_PR_BODY="true"
60+ else
61+ CONTAINS_MUTATE_FULL_IN_PR_BODY="false"
62+ fi
63+ echo "Contains '[mutate-full]' in PR body (from cleaned body): $CONTAINS_MUTATE_FULL_IN_PR_BODY"
64+
3165 echo "---------------------------------------------"
3266
3367 FINAL_MUTANT_MODE="full"
3468 FINAL_NUM_GROUPS=32
3569 FINAL_SINCE_TARGET=""
3670
3771 IS_MUTATE_FULL_TRIGGERED="false"
38- if [[ "${{ github.event_name }} " == "pull_request" && \
72+ if [[ "$EVENT_NAME " == "pull_request" && \
3973 ( "$CONTAINS_MUTATE_FULL_IN_PR_TITLE" == "true" || "$CONTAINS_MUTATE_FULL_IN_PR_BODY" == "true" ) ]]; then
4074 echo "Logic path: [mutate-full] in PR title/body."
4175 IS_MUTATE_FULL_TRIGGERED="true"
42- elif [[ "${{ github.event_name }} " == "push" && "$CONTAINS_MUTATE_FULL_IN_PUSH" == "true" ]]; then
76+ elif [[ "$EVENT_NAME " == "push" && "$CONTAINS_MUTATE_FULL_IN_PUSH" == "true" ]]; then
4377 echo "Logic path: [mutate-full] in push commit message(s)."
4478 IS_MUTATE_FULL_TRIGGERED="true"
4579 fi
@@ -49,21 +83,21 @@ jobs:
4983 FINAL_MUTANT_MODE="full"
5084 FINAL_NUM_GROUPS=32
5185 else
52- if [[ "${{ github.event_name }} " == "pull_request" ]]; then
86+ if [[ "$EVENT_NAME " == "pull_request" ]]; then
5387 echo "Logic path: Pull request event (no [mutate-full] trigger)."
5488 echo "Action: Mode set to 'incremental' (NUM_GROUPS=4) for PR."
5589 FINAL_MUTANT_MODE="incremental"
5690 FINAL_NUM_GROUPS=4
57- FINAL_SINCE_TARGET="origin/${{ github.event.pull_request.base.ref }} "
91+ FINAL_SINCE_TARGET="origin/$PR_BASE_REF "
5892 echo "Incremental target: $FINAL_SINCE_TARGET"
59- elif [[ "${{ github.event_name }} " == "push" ]]; then
60- if [[ "${{ github.ref_name }} " == "master" || "${{ github.ref_name }} " == "main" ]]; then
93+ elif [[ "$EVENT_NAME " == "push" ]]; then
94+ if [[ "$REF_NAME " == "master" || "$REF_NAME " == "main" ]]; then
6195 echo "Logic path: Push event to main branch (no [mutate-full] trigger)."
6296 echo "Action: Mode set to 'full' (NUM_GROUPS=32) for main branch."
6397 FINAL_MUTANT_MODE="full"
6498 FINAL_NUM_GROUPS=32
6599 else
66- echo "Logic path: Push event to non-main branch ('${{ github.ref_name }} ') (no [mutate-full] trigger)."
100+ echo "Logic path: Push event to non-main branch ('$REF_NAME ') (no [mutate-full] trigger)."
67101 echo "Action: Mode set to 'incremental' (NUM_GROUPS=4) for branch push."
68102 FINAL_MUTANT_MODE="incremental"
69103 FINAL_NUM_GROUPS=4
0 commit comments