@@ -10,27 +10,52 @@ name: Release Notifications
10
10
on :
11
11
release :
12
12
types :
13
- - released # this triggers when a release is published, but does not include prereleases or drafts
13
+ - released # this triggers when a release is published, but does not include pre-releases or drafts
14
14
15
15
jobs :
16
+ simplified_changelog :
17
+ if : >-
18
+ startsWith(github.repository, 'LizardByte/') &&
19
+ !github.event.release.prerelease &&
20
+ !github.event.release.draft
21
+ outputs :
22
+ SIMPLIFIED_BODY : ${{ steps.output.outputs.SIMPLIFIED_BODY }}
23
+ runs-on : ubuntu-latest
24
+ steps :
25
+ - name : remove contributors section
26
+ env :
27
+ RELEASE_BODY : ${{ github.event.release.body }}
28
+ id : output
29
+ run : |
30
+ echo "${RELEASE_BODY}" > ./release_body.md
31
+ modified_body=$(sed '/^---$/d; /^## Contributors$/,/<\/a>/d' ./release_body.md)
32
+ echo "modified_body: ${modified_body}"
33
+
34
+ # use a heredoc to ensure the output is multiline
35
+ echo "SIMPLIFIED_BODY<<EOF" >> $GITHUB_OUTPUT
36
+ echo "${modified_body}" >> $GITHUB_OUTPUT
37
+ echo "EOF" >> $GITHUB_OUTPUT
38
+
16
39
discord :
17
40
if : >-
18
41
startsWith(github.repository, 'LizardByte/') &&
19
42
!github.event.release.prerelease &&
20
43
!github.event.release.draft
44
+ needs : simplified_changelog
21
45
runs-on : ubuntu-latest
22
46
steps :
23
47
- name : discord
24
48
uses : sarisia/actions-status-discord@v1
25
49
with :
26
- webhook : ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
50
+ avatar_url : ${{ secrets.ORG_LOGO_URL }}
51
+ color : 0x00ff00
52
+ description : ${{ needs.simplified_changelog.outputs.SIMPLIFIED_BODY }}
27
53
nodetail : true
28
54
nofail : false
29
- username : ${{ secrets.DISCORD_USERNAME }}
30
- avatar_url : ${{ secrets.ORG_LOGO_URL }}
31
55
title : ${{ github.event.repository.name }} ${{ github.ref_name }} Released
32
- description : ${{ github.event.release.body }}
33
- color : 0xFF4500
56
+ url : ${{ github.event.release.html_url }}
57
+ username : ${{ secrets.DISCORD_USERNAME }}
58
+ webhook : ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
34
59
35
60
facebook_group :
36
61
if : >-
46
71
access_token : ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
47
72
message : |
48
73
${{ github.event.repository.name }} ${{ github.ref_name }} Released
49
- ${{ github.event.release.body }}
50
74
url : ${{ github.event.release.html_url }}
51
75
52
76
facebook_page :
@@ -63,14 +87,14 @@ jobs:
63
87
access_token : ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
64
88
message : |
65
89
${{ github.event.repository.name }} ${{ github.ref_name }} Released
66
- ${{ github.event.release.body }}
67
90
url : ${{ github.event.release.html_url }}
68
91
69
92
reddit :
70
93
if : >-
71
94
startsWith(github.repository, 'LizardByte/') &&
72
95
!github.event.release.prerelease &&
73
96
!github.event.release.draft
97
+ needs : simplified_changelog
74
98
runs-on : ubuntu-latest
75
99
steps :
76
100
- name : reddit
@@ -84,20 +108,20 @@ jobs:
84
108
title : ${{ github.event.repository.name }} ${{ github.ref_name }} Released
85
109
url : ${{ github.event.release.html_url }}
86
110
flair-id : ${{ secrets.REDDIT_FLAIR_ID }} # https://www.reddit.com/r/<subreddit>>/api/link_flair.json
87
- comment : ${{ github.event.release.body }}
111
+ comment : ${{ needs.simplified_changelog.outputs.SIMPLIFIED_BODY }}
88
112
89
- twitter :
113
+ x :
90
114
if : >-
91
115
startsWith(github.repository, 'LizardByte/') &&
92
116
!github.event.release.prerelease &&
93
117
!github.event.release.draft
94
118
runs-on : ubuntu-latest
95
119
steps :
96
- - name : twitter
120
+ - name : x
97
121
uses : nearform-actions/github-action-notify-twitter@v1
98
122
with :
99
123
message : ${{ github.event.release.html_url }}
100
- twitter-app-key : ${{ secrets.TWITTER_API_KEY }}
101
- twitter-app-secret : ${{ secrets.TWITTER_API_SECRET }}
102
- twitter-access-token : ${{ secrets.TWITTER_ACCESS_TOKEN }}
103
- twitter-access-token-secret : ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
124
+ twitter-app-key : ${{ secrets.X_APP_KEY }}
125
+ twitter-app-secret : ${{ secrets.X_APP_SECRET }}
126
+ twitter-access-token : ${{ secrets.X_ACCESS_TOKEN }}
127
+ twitter-access-token-secret : ${{ secrets.X_ACCESS_TOKEN_SECRET }}
0 commit comments