Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Slack notifications for automatic releases #4

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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