File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,13 @@ jobs:
6969 echo "- manifests/helm/kepler/values.yaml"
7070 fi
7171 echo "EOF"
72- } > /tmp/message.txt
72+ } > /tmp/message-${{ github.event.pull_request.number }} .txt
7373
7474 # NOTE: Uploading the message as an artifact so that PR Comment workflow can use it to
7575 # add comment on PR with the message.
7676 - name : Upload message
7777 uses : actions/upload-artifact@v4
7878 with :
7979 name : message
80- path : /tmp/message.txt
80+ path : /tmp/message-${{ github.event.pull_request.number }} .txt
8181 retention-days : 1 # Keep artifact for 1 days
Original file line number Diff line number Diff line change @@ -32,11 +32,18 @@ jobs:
3232 run-id : ${{ github.event.workflow_run.id }}
3333 github-token : ${{ secrets.GITHUB_TOKEN }}
3434
35- - name : Comment on PR
35+ - name : Extract PR number from filename
3636 if : steps.download-artifact.outcome == 'success'
37+ id : extract-pr
38+ run : |
39+ echo "message-file=$(ls /tmp/message*.txt)" >> $GITHUB_OUTPUT
40+ echo "pr-number=$(echo /tmp/message*.txt | sed -E 's/.*message-([0-9]+)\.txt/\1/')" >> $GITHUB_OUTPUT
41+
42+ - name : Comment on PR
43+ if : steps.download-artifact.outcome == 'success' && steps.extract-pr.outputs.pr-number != ''
3744 uses : thollander/actions-comment-pull-request@v3
3845 with :
39- file-path : /tmp/message.txt
46+ file-path : ${{ steps.extract-pr.outputs.message-file }}
4047 github-token : ${{ secrets.GITHUB_TOKEN }}
41- pr-number : ${{ github.event.workflow_run.pull_requests[0]. number }}
48+ pr-number : ${{ steps.extract-pr.outputs.pr- number }}
4249 reactions : eyes, rocket
Original file line number Diff line number Diff line change @@ -141,12 +141,12 @@ jobs:
141141 echo "gh run download ${{ github.run_id }} -n profile-artifacts-${{ github.event.pull_request.number }}"
142142 echo "\`\`\`"
143143 echo ""
144- } > /tmp/message.txt
144+ } > /tmp/message-${{ github.event.pull_request.number }} .txt
145145 # NOTE: Uploading the message as an artifact so that PR Comment workflow can use it to
146146 # add comment on PR with the message.
147147 - name : Upload message
148148 uses : actions/upload-artifact@v4
149149 with :
150150 name : message
151- path : /tmp/message.txt
151+ path : /tmp/message-${{ github.event.pull_request.number }} .txt
152152 retention-days : 1 # Keep artifact for 1 days
You can’t perform that action at this time.
0 commit comments