Skip to content

Commit a8b1f8a

Browse files
authored
ci: update workflows for nodejs projects (#568)
1 parent c8b5c37 commit a8b1f8a

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.github/workflows/if-nodejs-release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ jobs:
4848
- if: steps.packagejson.outputs.exists == 'true'
4949
name: Run test
5050
run: npm test
51+
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
52+
name: Report workflow run status to Slack
53+
uses: 8398a7/action-slack@v3
54+
with:
55+
status: ${{ job.status }}
56+
fields: repo,action,workflow
57+
text: 'Release workflow failed in testing job'
58+
env:
59+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
5160

5261
release:
5362
needs: [test-nodejs]
@@ -84,3 +93,12 @@ jobs:
8493
GIT_COMMITTER_NAME: asyncapi-bot
8594
GIT_COMMITTER_EMAIL: [email protected]
8695
run: npm run release
96+
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
97+
name: Report workflow run status to Slack
98+
uses: 8398a7/action-slack@v3
99+
with:
100+
status: ${{ job.status }}
101+
fields: repo,action,workflow
102+
text: 'Release workflow failed in release job'
103+
env:
104+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

.github/workflows/if-nodejs-version-bump.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424
- name: Check if Node.js project and has package.json
2525
id: packagejson
2626
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
27+
- if: steps.packagejson.outputs.exists == 'true'
28+
name: Setup Node.js
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: 14
32+
cache: 'npm'
33+
cache-dependency-path: '**/package-lock.json'
2734
- if: steps.packagejson.outputs.exists == 'true'
2835
name: Install dependencies
2936
run: npm install
@@ -46,4 +53,13 @@ jobs:
4653
author: asyncapi-bot <[email protected]>
4754
title: 'chore(release): ${{github.event.release.tag_name}}'
4855
body: 'Version bump in package.json for release [${{github.event.release.tag_name}}](${{github.event.release.html_url}})'
49-
branch: version-bump/${{github.event.release.tag_name}}
56+
branch: version-bump/${{github.event.release.tag_name}}
57+
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
58+
name: Report workflow run status to Slack
59+
uses: 8398a7/action-slack@v3
60+
with:
61+
status: ${{ job.status }}
62+
fields: repo,action,workflow
63+
text: 'Unable to bump the version in package.json after the release'
64+
env:
65+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

0 commit comments

Comments
 (0)