Skip to content

Commit 5d6e328

Browse files
committed
fixup again pr-comment
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 018d05a commit 5d6e328

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/pr-comment.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
pr-comment:
6060
runs-on: ubuntu-latest
6161
env:
62-
MESSAGE_FILE: "artifacts/${{ inputs.artifact_name}}"
6362
TARGET: "${{ inputs.target_repo }}"
6463
steps:
6564
- name: Validate inputs
@@ -101,26 +100,28 @@ jobs:
101100
102101
- name: Download message artifact
103102
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
103+
id: download
104104
uses: actions/download-artifact@v5
105105
with:
106-
run_id: "${{ inputs.run_id }}"
106+
run-id: "${{ inputs.run_id }}"
107107
repository: "${{ env.TARGET }}"
108108
name: "${{ inputs.artifact_name }}"
109109
path: artifacts/
110-
github_token: ${{secrets.GITHUB_TOKEN}}
110+
github-token: ${{secrets.GITHUB_TOKEN}}
111111

112112
- name: Check message artifact size
113113
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
114-
id: load_artifact
115114
run: |
115+
MESSAGE_FILE="${{ steps.download.outputs.download-path }}/${{ inputs.artifact_name }}"
116116
SIZE=$(wc -c "${MESSAGE_FILE}")
117117
if [[ "${SIZE}" -gt "${{ env.MAX_MESSAGE_SIZE }}" ]] ; then
118118
# truncate the message up to MAX_MESSAGE_SIZE
119119
head -c ${{ env.MAX_MESSAGE_SIZE }} "${MESSAGE_FILE}" > /tmp/truncated
120+
echo > /tmp/truncated
121+
echo "... (truncated)" > /tmp/truncated
120122
mv /tmp/truncated "${MESSAGE_FILE}"
121123
echo "::warning:: comment message with size ${SIZE} has been truncated to ${{ env.MAX_MESSAGE_SIZE }} bytes."
122124
fi
123-
echo "message=$(cat ${MESSAGE_FILE})" >> "${GITHUB_OUTPUT}"
124125
125126
- name: Find previous PR comment
126127
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
@@ -149,11 +150,10 @@ jobs:
149150
comment-id: ${{ steps.find_comment.outputs.comment-id }}
150151
reactions: ${{ inputs.reactions }}
151152
reactions-edit-mode: replace
152-
body-path: ${{ env.MESSAGE_FILE }}
153+
body-path: ${{ steps.download.outputs.download-path }}/${{ inputs.artifact_name }}
153154
edit-mode: replace
154155
token: ${{ steps.acquire_write_token.outputs.token }}
155156

156157
- name: Notify
157158
run: |
158159
echo "::notice::Commented pull request ${{ inputs.pr_number }}"
159-
echo "::debug::${{ steps.load_artifacts.outputs.message }}"

0 commit comments

Comments
 (0)