Skip to content

Commit 69b14c8

Browse files
authored
ci: send release announcements on publish (#2571)
1 parent 494703f commit 69b14c8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,30 @@ jobs:
124124
npm run build --workspace=@slack/socket-mode
125125
126126
- name: Publish to npm and create GitHub releases
127+
id: changesets
127128
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
128129
with:
129130
createGithubReleases: true
130131
publish: npm run changeset -- publish
131132
env:
132133
GITHUB_TOKEN: ${{ steps.credentials.outputs.token }}
134+
135+
- name: Get publication details
136+
if: steps.changesets.outputs.published == 'true'
137+
id: release
138+
run: |
139+
echo "message=$(echo "$PUBLISHED_PACKAGES" | jq -r '[.[] | "\(.name)@\(.version)"] | join(", ")')" >> "$GITHUB_OUTPUT"
140+
echo "action_url=$(echo "$PUBLISHED_PACKAGES" | jq -r '[.[] | "https://github.com/${{ github.repository }}/releases/tag/\(.name)@\(.version)"] | join("\n")')" >> "$GITHUB_OUTPUT"
141+
env:
142+
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
143+
144+
- name: Notify Slack
145+
if: steps.changesets.outputs.published == 'true'
146+
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
147+
with:
148+
webhook: ${{ secrets.SLACK_RELEASE_ANNOUNCEMENTS_WEBHOOK_URL }}
149+
webhook-type: webhook-trigger
150+
payload: |
151+
action_url: "${{ steps.release.outputs.action_url }}"
152+
message: "${{ steps.release.outputs.message }}"
153+
repository: "${{ github.repository }}"

0 commit comments

Comments
 (0)