Update used actions to avoid deprecation warnings

Also update deprecated set-output command and make html generation more robust.
This commit is contained in:
Gunter Labes 2023-06-20 14:04:58 +02:00 committed by GitHub
parent 3e494faaeb
commit 022162f7a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,8 +13,8 @@ jobs:
run:
working-directory: utils/wesnoth-map-diff
steps:
- uses: actions/checkout@v3.0.0
- uses: actions/setup-node@v3.0.0
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Package install
@ -54,12 +54,10 @@ jobs:
echo "Imgur result:"
echo "$curl_result"
image_link=$(jq -r ".data.link" <<< "$curl_result")
comment_body="$comment_body<h3>$map_path</h3><img src=\"$image_link\" /><br />"
comment_body+=$(jq -r --arg path "$map_path" '@html "<h3>\($path)</h3><img src=\"\(.data.link)\" /> <br />"' <<< "$curl_result")
done
echo "::set-output name=COMMENT_BODY::$comment_body"
printf 'COMMENT_BODY=%s\n' "$comment_body" >> "$GITHUB_OUTPUT"
- name: Find comment
uses: peter-evans/find-comment@v2
id: fc
@ -67,10 +65,9 @@ jobs:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
- name: Add comment
uses: peter-evans/create-or-update-comment@v1.4.5
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
${{ steps.get-maps-diff.outputs.COMMENT_BODY }}
body: ${{ steps.get-maps-diff.outputs.COMMENT_BODY }}