Skip to content

Commit 0736f95

Browse files
fix(ci): refactor notify action as a job of publish action; (#6176)
1 parent f4f2b03 commit 0736f95

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

.github/workflows/notify.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ on:
1212
# branches:
1313
# - main
1414
# - 'v**'
15-
push:
16-
tags:
17-
- 'v[0-9]+.[0-9]+.[0-9]+'
18-
branches:
19-
- main
20-
- 'v**'
15+
#push:
16+
# tags:
17+
# - 'v[0-9]+.[0-9]+.[0-9]+'
18+
# branches:
19+
# - main
20+
# - 'v**'
2121

2222
workflow_dispatch:
2323
inputs:

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,25 @@ jobs:
5656
run: npm publish --provenance --access public
5757
env:
5858
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
59+
notify:
60+
needs: [publish]
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v3
64+
with:
65+
fetch-depth: 0
66+
- name: git config
67+
run: |
68+
git config user.name "${GITHUB_ACTOR}"
69+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
70+
- name: Setup node
71+
uses: actions/setup-node@v3
72+
with:
73+
node-version: 18
74+
cache: npm
75+
- run: npm ci
76+
############# Add release comments and tags to published PRs ##############
77+
- name: Notify published PRs
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
run: node ./bin/actions/notify_published.js --tag ${{ github.event.inputs.tag || github.event.release.tag_name }}

0 commit comments

Comments
 (0)