@@ -68,64 +68,44 @@ jobs:
6868 # Configure git to use GITHUB_TOKEN for remote operations (has actions:write for workflow files)
6969 git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
7070
71- - name : ' Create Branches '
72- id : ' create_branches '
71+ - name : ' Create Patch '
72+ id : ' create_patch '
7373 env :
7474 GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
75- GH_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
76- continue-on-error : true
77- run : |
78- # Capture output and display it in logs using tee
79- {
80- node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }} --skip-pr-creation
81- echo "BRANCH_EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
82- } 2>&1 | tee >(
83- echo "BRANCH_LOG_CONTENT<<EOF" >> "$GITHUB_ENV"
84- cat >> "$GITHUB_ENV"
85- echo "EOF" >> "$GITHUB_ENV"
86- )
87-
88- - name : ' Create Pull Request'
89- id : ' create_pr'
90- if : ' always() && steps.create_branches.outputs.BRANCH_EXIT_CODE == 0'
91- env :
9275 GH_TOKEN : ' ${{ steps.generate_token.outputs.token }}'
9376 continue-on-error : true
9477 run : |
9578 # Capture output and display it in logs using tee
9679 {
97- node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }} --pr-only
98- echo "PR_EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
80+ node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }}
81+ EXIT_CODE=$?
82+ echo "EXIT_CODE=$EXIT_CODE" >> "$GITHUB_OUTPUT"
83+ exit $EXIT_CODE
9984 } 2>&1 | tee >(
100- echo "PR_LOG_CONTENT <<EOF" >> "$GITHUB_ENV"
85+ echo "LOG_CONTENT <<EOF" >> "$GITHUB_ENV"
10186 cat >> "$GITHUB_ENV"
10287 echo "EOF" >> "$GITHUB_ENV"
10388 )
10489
10590 - name : ' Comment on Original PR'
106- if : ' always() && inputs.original_pr'
91+ if : ' always() && github.event. inputs.original_pr'
10792 env :
10893 GH_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
10994 ORIGINAL_PR : ' ${{ github.event.inputs.original_pr }}'
110- EXIT_CODE : ' ${{ steps.create_branches .outputs.BRANCH_EXIT_CODE != 0 && steps.create_branches.outputs.BRANCH_EXIT_CODE || steps.create_pr.outputs.PR_EXIT_CODE }}'
95+ EXIT_CODE : ' ${{ steps.create_patch .outputs.EXIT_CODE }}'
11196 COMMIT : ' ${{ github.event.inputs.commit }}'
11297 CHANNEL : ' ${{ github.event.inputs.channel }}'
11398 REPOSITORY : ' ${{ github.repository }}'
11499 GITHUB_RUN_ID : ' ${{ github.run_id }}'
115- LOG_CONTENT : ' ${{ steps.create_branches.outputs.BRANCH_EXIT_CODE != 0 && env.BRANCH_LOG_CONTENT || env.PR_LOG_CONTENT }}'
100+ LOG_CONTENT : ' ${{ env.LOG_CONTENT }}'
116101 continue-on-error : true
117102 run : |
118103 git checkout '${{ github.event.inputs.ref }}'
119104 node scripts/releasing/patch-create-comment.js
120105
121- - name : ' Fail Workflow if Tasks Failed'
122- if : ' always() && ( steps.create_branches .outputs.BRANCH_EXIT_CODE != 0 || steps.create_pr.outputs.PR_EXIT_CODE != 0) '
106+ - name : ' Fail Workflow if Main Task Failed'
107+ if : ' always() && steps.create_patch .outputs.EXIT_CODE != 0'
123108 run : |
124- if [[ "${{ steps.create_branches.outputs.BRANCH_EXIT_CODE }}" != "0" ]]; then
125- echo "Branch creation failed with exit code: ${{ steps.create_branches.outputs.BRANCH_EXIT_CODE }}"
126- fi
127- if [[ "${{ steps.create_pr.outputs.PR_EXIT_CODE }}" != "0" ]]; then
128- echo "PR creation failed with exit code: ${{ steps.create_pr.outputs.PR_EXIT_CODE }}"
129- fi
109+ echo "Patch creation failed with exit code: ${{ steps.create_patch.outputs.EXIT_CODE }}"
130110 echo "Check the logs above and the comment posted to the original PR for details."
131111 exit 1
0 commit comments