-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port slack notification over from KDS (#13)
* port over from KDS * add changeset * update messaging
- Loading branch information
Showing
2 changed files
with
14 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,43 +9,37 @@ jobs: | |
version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
published: ${{ steps.changesets.outputs.published }} | ||
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }} | ||
hasPublished: ${{ steps.changesets.outputs.published }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup | ||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
run: | | ||
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN" | ||
- uses: changesets/action@v1 | ||
id: changesets | ||
with: | ||
title: "Changeset: Version packages" | ||
commit: "version packages" | ||
version: yarn ci:version | ||
publish: yarn ci:publish | ||
- name: Push git tags | ||
if: steps.changesets.outputs.published == 'true' | ||
run: git push --follow-tags | ||
notify: | ||
notify-slack: | ||
runs-on: ubuntu-latest | ||
needs: version | ||
needs: | ||
version | ||
# We only trigger this flow if the publish is happening, inferred by not having a changeset. | ||
if: needs.version.outputs.hasChangesets == 'false' | ||
env: | ||
PUBLISHED: ${{ needs.version.outputs.hasPublished }} | ||
steps: | ||
- name: Publish successful | ||
if: needs.version.outputs.published == 'true' | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: "C02NUQ27G56" | ||
slack-message: "Legacy Packages have been published" | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
- name: Publish failed | ||
if: needs.version.outputs.published == 'false' | ||
- name: Send | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: "C02NUQ27G56" | ||
slack-message: "Legacy Publish failed" | ||
slack-message: ${{ env.PUBLISHED == 'true' && 'Legacy packages have been published' || 'Legacy Publishing failed' }} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |