@@ -3,6 +3,9 @@ name: External Trigger Main
3
3
on :
4
4
workflow_dispatch :
5
5
6
+ permissions :
7
+ contents : read
8
+
6
9
jobs :
7
10
external-trigger-main :
8
11
runs-on : ubuntu-latest
44
47
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
45
48
exit 1
46
49
fi
47
- EXT_RELEASE =$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
48
- echo "External version: \`${EXT_RELEASE }\`" >> $GITHUB_STEP_SUMMARY
50
+ EXT_RELEASE_SANITIZED =$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
51
+ echo "Sanitized external version: \`${EXT_RELEASE_SANITIZED }\`" >> $GITHUB_STEP_SUMMARY
49
52
echo "Retrieving last pushed version" >> $GITHUB_STEP_SUMMARY
50
53
image="linuxserver/socket-proxy"
51
54
tag="latest"
@@ -101,8 +104,8 @@ jobs:
101
104
exit 1
102
105
fi
103
106
echo "Last pushed version: \`${IMAGE_VERSION}\`" >> $GITHUB_STEP_SUMMARY
104
- if [ "${EXT_RELEASE }" == "${IMAGE_VERSION}" ]; then
105
- echo "Version \`${EXT_RELEASE }\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
107
+ if [ "${EXT_RELEASE_SANITIZED }" == "${IMAGE_VERSION}" ]; then
108
+ echo "Sanitized version \`${EXT_RELEASE_SANITIZED }\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
106
109
exit 0
107
110
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"haproxy"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
108
111
echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
@@ -124,7 +127,7 @@ jobs:
124
127
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
125
128
else
126
129
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
127
- echo "New version \`${EXT_RELEASE }\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
130
+ echo "New sanitized version \`${EXT_RELEASE_SANITIZED }\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
128
131
if [[ "${artifacts_found}" == "true" ]]; then
129
132
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
130
133
fi
@@ -144,7 +147,7 @@ jobs:
144
147
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
145
148
--data-urlencode "Submit=Submit"
146
149
echo "**** Notifying Discord ****"
147
- TRIGGER_REASON="A version change was detected for socket-proxy tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE }"
150
+ TRIGGER_REASON="A version change was detected for socket-proxy tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE_SANITIZED }"
148
151
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
149
152
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
150
153
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
0 commit comments