Skip to content

Commit 1dd45bf

Browse files
committed
Add workflow to update package
1 parent fb85d90 commit 1dd45bf

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update documents repository
2+
3+
on:
4+
push:
5+
branches:
6+
- actions
7+
- master
8+
workflow_dispatch:
9+
10+
jobs:
11+
update_documents:
12+
runs-on: ubuntu-latest
13+
concurrency:
14+
group: ${{ github.workflow }}
15+
cancel-in-progress: true
16+
env:
17+
# for debug
18+
OWNER: ${{ github.repository_owner }}
19+
REPOSITORY: ${{ github.repository }}
20+
PACKAGES_REPO: ${{ vars.PACKAGES_REPO }}
21+
PACKAGES_WORKFLOW: ${{ vars.PACKAGES_WORKFLOW }}
22+
PACKAGES_TARGET: 'wanderlust wanderlust-utils'
23+
steps:
24+
- name: Get app-token
25+
uses: actions/create-github-app-token@v1
26+
id: app-token
27+
with:
28+
app-id: ${{ secrets.WLDOCS_APP_ID }}
29+
private-key: ${{ secrets.WLDOCS_PRIVATE_KEY }}
30+
owner: ${{ github.repository_owner }}
31+
repositories: ${{ vars.PACKAGES_REPO }}
32+
- name: Dispatch workflow to update document repository
33+
uses: actions/github-script@v7
34+
with:
35+
github-token: ${{ steps.app-token.outputs.token }}
36+
script: |
37+
await github.rest.actions.createWorkflowDispatch({
38+
owner: '${{ github.repository_owner }}',
39+
repo: '${{ vars.PACKAGES_REPO }}',
40+
workflow_id: '${{ vars.PACKAGES_WORKFLOW }}',
41+
inputs: {
42+
targets: '${{ env.PACKAGES_TARGET }}'
43+
},
44+
ref: 'wanderlust'})

0 commit comments

Comments
 (0)