Bot Updating Templated Files

This commit is contained in:
LinuxServer-CI 2021-10-26 23:16:15 +02:00
parent 2ee4966213
commit 6d8712671c

View File

@ -32,7 +32,7 @@ jobs:
echo "**** External version: ${EXT_RELEASE} ****"
echo "**** Retrieving last pushed version ****"
image="linuxserver/code-server"
tag="latest"
tag="focal"
token=$(curl -sX GET \
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fcode-server%3Apull" \
| jq -r '.token')
@ -54,7 +54,7 @@ jobs:
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
if [ -z "${IMAGE_VERSION}" ]; then
echo "**** Can't retrieve last pushed version, exiting ****"
FAILURE_REASON="Can't retrieve last pushed version for code-server tag latest"
FAILURE_REASON="Can't retrieve last pushed version for code-server tag focal"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
@ -85,7 +85,7 @@ jobs:
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--data-urlencode "Submit=Submit"
echo "**** Notifying Discord ****"
TRIGGER_REASON="A version change was detected for code-server tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
TRIGGER_REASON="A version change was detected for code-server tag focal. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}