Skip to content

Commit e6c8ad9

Browse files
committed
chore: add header through notifications
1 parent d795f15 commit e6c8ad9

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

.github/actions/notifications/action.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Send Notification
22
description: Sends a notification with apprise
33

44
inputs:
5+
gh_verification:
6+
required: true
7+
description: "GitHub verification token"
58
apprise_configuration:
69
required: true
710
description: "Apprise configuration URL"
@@ -27,6 +30,7 @@ runs:
2730
set -euo pipefail
2831
2932
CURL_ARGS=(-X POST)
33+
CURL_ARGS+=(-H "gh-verification: ${GH_VERIFICATION}")
3034
CURL_ARGS+=(-F "title=${TITLE}")
3135
CURL_ARGS+=(-F "body=$(printf '%s' "${BODY}")")
3236
CURL_ARGS+=(-F "tags=${TAGS}")
@@ -36,8 +40,13 @@ runs:
3640
fi
3741
3842
echo "Sending notification with title: ${TITLE}"
39-
curl "${CURL_ARGS[@]}" "${APPRISE_CONFIG}"
43+
44+
if ! curl "${CURL_ARGS[@]}" "${APPRISE_CONFIG}" > /dev/null 2>&1; then
45+
echo "::error ::Failed to send notification (curl exited with error)."
46+
exit 1
47+
fi
4048
env:
49+
GH_VERIFICATION: ${{ inputs.gh_verification }}
4150
APPRISE_CONFIG: ${{ inputs.apprise_configuration }}
4251
BODY: ${{ inputs.body }}
4352
TITLE: ${{ inputs.title }}

.github/workflows/ci-cd.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ jobs:
155155
with:
156156
title: "Image rebuilds successful"
157157
tags: '${{ secrets.APPRISE_TAGS }}'
158+
gh_verification: '${{ secrets.GH_VERIFICATION }}'
158159
apprise_configuration: '${{ secrets.APPRISE_CONFIG }}'
159160
body: |
160161
✅ **Image Rebuilds Complete**
@@ -169,7 +170,6 @@ jobs:
169170
🔗 Commit: [${{ github.event.head_commit.message }}](${{ github.event.head_commit.url }})
170171
🔗 Workflow: [${{ github.workflow }}](${{ github.run_url }})
171172
🔗 Repository: [${{ github.repository }}](${{ github.event.repository.html_url }})
172-
173173
notify-failure:
174174
runs-on: ubuntu-latest
175175
needs: [generate-build-matrix, images-build]
@@ -188,6 +188,7 @@ jobs:
188188
title: "Image rebuilds failed"
189189
tags: '${{ secrets.APPRISE_TAGS }}'
190190
apprise_configuration: '${{ secrets.APPRISE_CONFIG }}'
191+
gh_verification: '${{ secrets.GH_VERIFICATION }}'
191192
body: |
192193
❌ **Image Rebuilds Failed**
193194

.github/workflows/manual-release-all.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ jobs:
124124
title: "Scheduled Release Complete"
125125
tags: '${{ secrets.APPRISE_TAGS }}'
126126
apprise_configuration: '${{ secrets.APPRISE_CONFIG }}'
127+
gh_verification: '${{ secrets.GH_VERIFICATION }}'
127128
body: |
128129
✅ **Image Rebuilds Complete**
129130
@@ -156,6 +157,7 @@ jobs:
156157
title: "Scheduled Release Failed"
157158
tags: '${{ secrets.APPRISE_TAGS }}'
158159
apprise_configuration: '${{ secrets.APPRISE_CONFIG }}'
160+
gh_verification: '${{ secrets.GH_VERIFICATION }}'
159161
body: |
160162
❌ **Image Rebuilds Failed**
161163

.github/workflows/schedule-release.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ jobs:
126126
title: "Scheduled Release Complete"
127127
tags: '${{ secrets.APPRISE_TAGS }}'
128128
apprise_configuration: '${{ secrets.APPRISE_CONFIG }}'
129+
gh_verification: '${{ secrets.GH_VERIFICATION }}'
129130
body: |
130131
✅ **Image Rebuilds Complete**
131132
@@ -158,6 +159,7 @@ jobs:
158159
title: "Scheduled Release Failed"
159160
tags: '${{ secrets.APPRISE_TAGS }}'
160161
apprise_configuration: '${{ secrets.APPRISE_CONFIG }}'
162+
gh_verification: '${{ secrets.GH_VERIFICATION }}'
161163
body: |
162164
❌ **Image Rebuilds Failed**
163165

apps/tshock/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ VOLUME ["/config", "/tshock/logs", "/tshock/ServerPlugins"]
4343

4444
EXPOSE 7777 7878
4545

46+
4647
RUN apt-get update -y && \
4748
apt-get install -y nuget jq tmux && \
4849
rm -rf /var/lib/apt/lists/* /tmp/*

0 commit comments

Comments
 (0)