2424
2525 - name : Checkout PR branch
2626 run : |
27- gh pr checkout ${{ github.event.inputs.pr_number } }
27+ gh pr checkout ${GITHUB_EVENT_INPUTS_PR_NUMBER }
2828 env :
2929 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30+ GITHUB_EVENT_INPUTS_PR_NUMBER : ${{ github.event.inputs.pr_number }}
3031
3132 - name : Run build script
3233 id : build
@@ -79,33 +80,39 @@ jobs:
7980 - name : Comment on PR - No changes
8081 if : steps.update.outcome == 'success' && steps.check-changes.outputs.changes == 'false'
8182 run : |
82- gh pr comment ${{ github.event.inputs.pr_number } } \
83+ gh pr comment ${GITHUB_EVENT_INPUTS_PR_NUMBER } \
8384 --body "No baselines were updated."
8485 env :
8586 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
87+ GITHUB_EVENT_INPUTS_PR_NUMBER : ${{ github.event.inputs.pr_number }}
8688
8789 - name : Comment on PR - Changes pushed
8890 if : steps.commit.outcome == 'success'
8991 run : |
90- gh pr comment ${{ github.event.inputs.pr_number } } \
92+ gh pr comment ${GITHUB_EVENT_INPUTS_PR_NUMBER } \
9193 --body "Baselines updated."
9294 env :
9395 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
96+ GITHUB_EVENT_INPUTS_PR_NUMBER : ${{ github.event.inputs.pr_number }}
9497
9598 - name : Comment on PR - Failure
9699 if : steps.build.outcome == 'failure' || steps.update.outcome == 'failure' || (steps.check-changes.outputs.changes == 'true' && steps.commit.outcome == 'failure')
97100 run : |
98101 ERROR_MSG="Update baselines failed"
99102
100- if [[ "${{ steps.build.outcome } }" == "failure" ]]; then
103+ if [[ "${STEPS_BUILD_OUTCOME }" == "failure" ]]; then
101104 ERROR_MSG="$ERROR_MSG: Build script failed"
102- elif [[ "${{ steps.update.outcome } }" == "failure" ]]; then
105+ elif [[ "${STEPS_UPDATE_OUTCOME }" == "failure" ]]; then
103106 ERROR_MSG="$ERROR_MSG: Update baselines script failed"
104- elif [[ "${{ steps.commit.outcome } }" == "failure" ]]; then
107+ elif [[ "${STEPS_COMMIT_OUTCOME }" == "failure" ]]; then
105108 ERROR_MSG="$ERROR_MSG: Failed to commit or push changes"
106109 fi
107110
108- gh pr comment ${{ github.event.inputs.pr_number } } \
111+ gh pr comment ${GITHUB_EVENT_INPUTS_PR_NUMBER } \
109112 --body "$ERROR_MSG"
110113 env :
111- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
115+ STEPS_BUILD_OUTCOME : ${{ steps.build.outcome }}
116+ STEPS_UPDATE_OUTCOME : ${{ steps.update.outcome }}
117+ STEPS_COMMIT_OUTCOME : ${{ steps.commit.outcome }}
118+ GITHUB_EVENT_INPUTS_PR_NUMBER : ${{ github.event.inputs.pr_number }}
0 commit comments