Skip to content

Commit 60ab944

Browse files
committed
fix: update github action workflow configuration
1 parent 83adeff commit 60ab944

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

.github/workflows/Publish-to-NPM.yml

+26-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
name: Test and publish to NPM
22
on:
33
push:
4-
# Sequence of patterns matched against refs/tags
54
tags:
6-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
5+
- 'v*'
76
jobs:
87
build:
98
runs-on: ubuntu-latest
109
steps:
11-
- uses: actions/checkout@v2
12-
# Setup .npmrc file to publish to npm
13-
- uses: actions/setup-node@v2
10+
- uses: actions/checkout@v3
11+
12+
- uses: actions/setup-node@v3
1413
with:
15-
node-version: '16.x'
14+
node-version: '18.x'
1615
registry-url: 'https://registry.npmjs.org'
17-
- run: npm install
18-
- run: npm test
19-
- run: npm publish
16+
17+
- name: Install dependencies
18+
run: npm ci
19+
20+
- name: Run tests
21+
run: npm test
22+
23+
- name: Publish to NPM
24+
run: npm publish
2025
env:
2126
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22-
# Use action slack
23-
- uses: 8398a7/action-slack@v3
27+
28+
- name: Slack Notification
29+
uses: 8398a7/action-slack@v3
2430
with:
2531
status: ${{ job.status }}
26-
fields: repo,message,commit,author,action,eventName,ref,job,took,workflow # selectable (default: repo,message)
32+
fields: repo,message,commit,author,action,eventName,ref,job,took
33+
mention: 'here'
34+
if_mention: failure,cancelled
35+
text: |
36+
Deploy ${{ job.status }}
37+
Repository: ${{ github.repository }}
38+
Commit: ${{ github.sha }}
2739
env:
28-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
29-
if: always() # Pick up events even if the job fails or is canceled.
40+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
41+
if: always()

0 commit comments

Comments
 (0)