File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed
Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 1111 publish :
1212 runs-on : ubuntu-latest
1313 permissions :
14- contents : read
14+ contents : write
1515 id-token : write
1616 steps :
1717 - uses : actions/checkout@v4
2727 - run : npm publish --provenance --access public
2828 env :
2929 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
30+
31+ - run : sleep 30s
32+
33+ - run : |
34+ npm_package=$(node -p 'require("./package.json").name')
35+ npm_version=$(node -p 'require("./package.json").version')
36+
37+ curl -L \
38+ -X POST \
39+ -H "Accept: application/vnd.github+json" \
40+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
41+ -H "X-GitHub-Api-Version: 2022-11-28" \
42+ https://api.github.com/repos/Koenkk/zigbee2mqtt/dispatches \
43+ -d '{ "event_type": "update_dep", "client_payload": { "package": "$npm_package", "version": "$npm_version" } }'
Original file line number Diff line number Diff line change 1+ name : Trigger Z2M update_dep workflow
2+
3+ on :
4+ workflow_dispatch :
5+
6+ permissions :
7+ contents : read
8+
9+ jobs :
10+ publish :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : write
14+ id-token : write
15+ steps :
16+ - uses : actions/checkout@v4
17+
18+ # Setup .npmrc file to publish to npm
19+ - uses : actions/setup-node@v4
20+ with :
21+ node-version-file : ' package.json'
22+ registry-url : ' https://registry.npmjs.org'
23+
24+ - run : |
25+ npm_package=$(node -p 'require("./package.json").name')
26+ npm_version=$(node -p 'require("./package.json").version')
27+
28+ curl -L \
29+ -X POST \
30+ -H "Accept: application/vnd.github+json" \
31+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
32+ -H "X-GitHub-Api-Version: 2022-11-28" \
33+ https://api.github.com/repos/Koenkk/zigbee2mqtt/dispatches \
34+ -d '{ "event_type": "update_dep", "client_payload": { "package": "$npm_package", "version": "$npm_version" } }'
You can’t perform that action at this time.
0 commit comments