Skip to content

Commit

Permalink
Integrate Slack notifications for automatic releases (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-wd authored Dec 9, 2023
1 parent b2c1d61 commit 2ae958b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
if: github.event.release.target_commitish == 'main'
outputs:
package-version: ${{ steps.get_version.outputs.version }}
steps:
- name: Check out the repository
uses: actions/checkout@v3
Expand All @@ -25,3 +27,15 @@ jobs:
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get the package version
id: get_version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"

- name: Notify Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_TITLE: 'Deployment Status'
SLACK_MESSAGE: 'npm package @webredone/trb-cli version ${{ steps.get_version.outputs.version }} published successfully!'
SLACK_COLOR: '#36a64f'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webredone/trb-cli",
"version": "2.0.1",
"version": "2.0.2",
"description": "TRB-CLI is a handy Node.js CLI that automates the process of managing blocks in a Theme Redone WordPress theme",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit 2ae958b

Please sign in to comment.