7373
7474 - name : ci:force flag parser
7575 shell : bash
76+ env :
77+ EVENT_NAME : ${{ github.event_name }}
78+ ACTOR : ${{ github.actor }}
7679 run : |
77- if [ "${{ github.event_name }} " == "schedule" ] || [ "${{ github.actor }} " == "dependabot[bot]" ]; then
80+ if [ "$EVENT_NAME " == "schedule" ] || [ "$ACTOR " == "dependabot[bot]" ]; then
7881 echo -e "\033[32mci:force check can be skipped\033[0m"
7982 skip_check="true"
8083 elif [[ "$COMMIT_MESSAGE" == *"[ci:force]"* ]]; then
@@ -91,28 +94,33 @@ jobs:
9194
9295 - name : show pr number
9396 shell : bash
97+ env :
98+ PR_NUMBER : ${{ steps.action.outputs.number }}
9499 run : |
95- echo "PR: ${{ steps.action.outputs.number }} "
100+ echo "PR: $PR_NUMBER "
96101
97102 - name : check if pr is approved
98103 env :
99104 DEVEL_FLAG : ${{ inputs.devel }}
100105 GH_TOKEN : ${{ github.token }}
101106 skip_check : " false"
107+ EVENT_NAME : ${{ github.event_name }}
108+ ACTOR : ${{ github.actor }}
109+ PR_NUMBER : ${{ steps.action.outputs.number }}
102110 run : |
103- if [ "${{ github.event_name }} " == "schedule" ] || [ "${{ github.actor }} " == "dependabot[bot]" ]; then
111+ if [ "$EVENT_NAME " == "schedule" ] || [ "$ACTOR " == "dependabot[bot]" ]; then
104112 echo -e "\033[32mci:force check can be skipped\033[0m"
105113 skip_check="true"
106114 elif [[ "$COMMIT_MESSAGE" == *"[ci:force]"* ]]; then
107115 echo -e "\033[32m[ci:force] flag detected. No need for approval.\033[0m"
108116 skip_check="true"
109117 fi
110118
111- if [ "${{ github.actor }} " == "dependabot[bot]" ] || [ "${{ github.actor }} " == "alfresco-build" ]; then
112- echo -e "\033[32mCommit by ${{ github.actor }} . No need for approval.\033[0m"
119+ if [ "$ACTOR " == "dependabot[bot]" ] || [ "$ACTOR " == "alfresco-build" ]; then
120+ echo -e "\033[32mCommit by $ACTOR . No need for approval.\033[0m"
113121 skip_check="true"
114122 fi
115- if [ "${{ github.event_name }} " == "schedule" ] || [ "${{ github.event_name }} " == "workflow_dispatch" ]; then
123+ if [ "$EVENT_NAME " == "schedule" ] || [ "$EVENT_NAME " == "workflow_dispatch" ]; then
116124 echo -e "\033[32mSchedule event\033[0m"
117125 skip_check="true"
118126 fi
@@ -124,7 +132,7 @@ jobs:
124132
125133 if [ "$skip_check" == "false" ]; then
126134 echo "Checking PR approval"
127- prNumber=${{ steps.action.outputs.number }}
135+ prNumber=$PR_NUMBER
128136 echo "PR: $prNumber"
129137 checkApproval=$(gh api /repos/$GITHUB_REPOSITORY/pulls/$prNumber/reviews | jq '.[] | select(.state == "APPROVED") | .user.login')
130138 if [[ $checkApproval ]]; then
@@ -184,8 +192,10 @@ jobs:
184192 - uses : ./.github/actions/setup
185193 - uses : ./.github/actions/download-node-modules-and-artifacts
186194 - name : Run unit tests
195+ env :
196+ EXCLUDE_PATTERN : ${{ matrix.unit-tests.exclude }}
187197 run : |
188- /usr/bin/xvfb-run --auto-servernum npm run test:affected -- $NX_CALCULATION_FLAGS --exclude=${{ matrix.unit-tests.exclude }}
198+ /usr/bin/xvfb-run --auto-servernum npm run test:affected -- $NX_CALCULATION_FLAGS --exclude=$EXCLUDE_PATTERN
189199
190200 lint :
191201 # long timeout required when cache has to be recreated
@@ -241,9 +251,12 @@ jobs:
241251 core.setFailed('The PR contains a forbidden label! You are not allowed to merge until the label is there.');
242252 }
243253 - name : Check value after
254+ env :
255+ STEP_RESULT : ${{ toJson(steps.pr-forbidden.*.result) }}
256+ HAS_FAILURE : ${{ contains(toJson(steps.pr-forbidden.*.result), 'failure') }}
244257 run : |
245- echo "result ${{ toJson(steps.pr-forbidden.*. result) }}" && echo "result ${{ steps.pr-forbidden.*.result }} "
246- echo "result ${{ contains(toJson(steps.pr-forbidden.*.result), ' failure') }} "
258+ echo "Step result: $STEP_RESULT "
259+ echo "Has failure: $HAS_FAILURE "
247260
248261 finalize :
249262 if : ${{ always() }}
0 commit comments