fix: use format everywhere

This commit is contained in:
Gottfried Mayer 2024-11-09 11:40:51 +00:00
parent ad19ea1b63
commit 856fee77ba

View File

@ -21,16 +21,16 @@ runs:
id: shorten-sha id: shorten-sha
shell: bash shell: bash
env: env:
FULLSHA: ${{ github.sha }} FULLSHA: "${{ format('{0}', github.sha) }}"
run: echo "shortsha=[${FULLSHA:0:8}]" >> $GITHUB_OUTPUT run: echo "shortsha=[${FULLSHA:0:8}]" >> $GITHUB_OUTPUT
- name: Send notification - name: Send notification
shell: bash shell: bash
env: env:
NTFYMSG: ${{ (startsWith(github.ref, 'refs/tags/') && format('Tag {0} created', github.ref_name) || format('{0} {1}', steps.shorten-sha.outputs.shortsha, github.event.head_commit.message)) }} NTFYMSG: ${{ (startsWith(github.ref, 'refs/tags/') && format('Tag {0} created', github.ref_name) || format('{0} {1}', steps.shorten-sha.outputs.shortsha, github.event.head_commit.message)) }}
NTFYTAGS: "Tags: ${{ inputs.jobstatus == 'success' && 'white_check_mark' || 'x' }}" NTFYTAGS: "${{ format('Tags: {0}', inputs.jobstatus == 'success' && 'white_check_mark' || 'x') }}"
NTFYTITLE: "Title: ${{ github.repository }} - Build # ${{ github.run_number }} ${{ inputs.jobstatus }}" NTFYTITLE: "${{ format('Title: {0} - Build {1} {2}', github.repository, github.run_number, inputs.jobstatus) }}"
NTFYICON: "Icon: ${{ github.event.repository.avatar_url }}" NTFYICON: "${{ format('Icon: {0}', github.event.repository.avatar_url) }}"
NTFYURL: "https://ntfy.sh/${{ inputs.topic }}" NTFYURL: "${{ format('https://ntfy.sh/{0}', inputs.topic) }}"
NTFYTOKEN: "Authorization: Bearer ${{ inputs.token }}" NTFYTOKEN: "${{ format('Authorization: Bearer {0}', inputs.token) }}"
run: 'curl -s -o /dev/null -H "$NTFYTAGS" -H "$NTFYTITLE" -H "$NTFYICON" -H "$NTFYTOKEN" -d "$NTFYMSG" $NTFYURL' run: 'curl -s -o /dev/null -H "$NTFYTAGS" -H "$NTFYTITLE" -H "$NTFYICON" -H "$NTFYTOKEN" -d "$NTFYMSG" $NTFYURL'