Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5cdbedc

Browse files
committedMay 21, 2025··
Workflow: Updated with passing client payload for release metadata
1 parent 7ab7bf8 commit 5cdbedc

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed
 

‎.github/workflows/release-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
2222
-H "X-GitHub-Api-Version: 2022-11-28" \
2323
"https://api.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/dispatches" \
24-
-d "{"event_type": "trigger-preview-build", "client_payload": {"environment": "preview", "hugo_theme_override": ""}}"
24+
-d "{"event_type": "trigger-preview-build", "client_payload": {"environment": "preview", "hugo_theme_override": "", "author": "${{ github.event.release.author }}", "tag_name": "${{ github.event.release.tag_name }}", "release_name": "${{ github.event.release.name }}"}}"

‎.github/workflows/slack-notification.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Slack notification for new theme release
22

3-
on:
4-
pull_request:
5-
# repository_dispatch:
6-
# types: [trigger-slack-notification]
3+
on:
4+
repository_dispatch:
5+
types: [trigger-slack-notification]
76

87
permissions:
98
contents: read
@@ -25,26 +24,22 @@ jobs:
2524
username: 'Github',
2625
mention: 'channel',
2726
attachments: [{
28-
title: `New theme release - SOME RELEASE NAME`,
27+
title: `New theme release - ${{ github.event.client_payload.release_name }}`,
2928
color: '#009223',
30-
fields: [{
31-
title: 'Preview',
32-
value: `SOME PREVIEW LINK`,
33-
short: false
34-
},
29+
fields: [
3530
{
3631
title: 'Tag',
37-
value: `SOME RELEASE TAG NAME`,
32+
value: ${{ github.event.client_payload.tag_name }},
3833
short: true
3934
},
4035
{
4136
title: 'Author',
42-
value: `SOME RELEASE AUTHOR`,
37+
value: ${{ github.event.client_payload.author }},
4338
short: true
4439
},
4540
{
4641
title: 'Preview URL',
47-
value: `SOME PREVIEW URL`,
42+
value: ${{ github.event.client_payload.previewURL }},
4843
short: true
4944
}]
5045
}]

0 commit comments

Comments
 (0)
Please sign in to comment.