Skip to content
This repository was archived by the owner on Oct 13, 2024. It is now read-only.

Commit 03d8bfc

Browse files
chore: update global workflows (#450)
1 parent 2b5a6c2 commit 03d8bfc

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

.github/workflows/release-notifier.yml

+39-15
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,52 @@ name: Release Notifications
1010
on:
1111
release:
1212
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
1414

1515
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+
1639
discord:
1740
if: >-
1841
startsWith(github.repository, 'LizardByte/') &&
1942
!github.event.release.prerelease &&
2043
!github.event.release.draft
44+
needs: simplified_changelog
2145
runs-on: ubuntu-latest
2246
steps:
2347
- name: discord
2448
uses: sarisia/actions-status-discord@v1
2549
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 }}
2753
nodetail: true
2854
nofail: false
29-
username: ${{ secrets.DISCORD_USERNAME }}
30-
avatar_url: ${{ secrets.ORG_LOGO_URL }}
3155
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 }}
3459

3560
facebook_group:
3661
if: >-
@@ -46,7 +71,6 @@ jobs:
4671
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
4772
message: |
4873
${{ github.event.repository.name }} ${{ github.ref_name }} Released
49-
${{ github.event.release.body }}
5074
url: ${{ github.event.release.html_url }}
5175

5276
facebook_page:
@@ -63,14 +87,14 @@ jobs:
6387
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
6488
message: |
6589
${{ github.event.repository.name }} ${{ github.ref_name }} Released
66-
${{ github.event.release.body }}
6790
url: ${{ github.event.release.html_url }}
6891

6992
reddit:
7093
if: >-
7194
startsWith(github.repository, 'LizardByte/') &&
7295
!github.event.release.prerelease &&
7396
!github.event.release.draft
97+
needs: simplified_changelog
7498
runs-on: ubuntu-latest
7599
steps:
76100
- name: reddit
@@ -84,20 +108,20 @@ jobs:
84108
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
85109
url: ${{ github.event.release.html_url }}
86110
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 }}
88112

89-
twitter:
113+
x:
90114
if: >-
91115
startsWith(github.repository, 'LizardByte/') &&
92116
!github.event.release.prerelease &&
93117
!github.event.release.draft
94118
runs-on: ubuntu-latest
95119
steps:
96-
- name: twitter
120+
- name: x
97121
uses: nearform-actions/github-action-notify-twitter@v1
98122
with:
99123
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

Comments
 (0)