Skip to content

Commit 33e8046

Browse files
committed
chore: add workflow_dispatch to trigger Z2M update_dep
1 parent e03d9b5 commit 33e8046

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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" } }'

0 commit comments

Comments
 (0)