generated from JustSleightly/VPM-Package-Template
-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (32 loc) · 1.04 KB
/
trigger-repo-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Trigger Repo Update
on:
release:
types: [published, unpublished, created, edited, deleted]
repository_dispatch:
types:
- trigger-repo-update
workflow_dispatch:
env:
triggerUpdate: ${{ true }}
repoOwner: "JeTeeS"
repoName: "TES-VPM-Package-Listing"
repoBranch: "main"
workflowName: "build-listing.yml"
accessToken: ${{ secrets.TESVPMPACKAGELISTING_TOKEN }}
jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Trigger Repo Update
if: ${{ env.triggerUpdate == 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{ env.accessToken }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: '${{ env.repoOwner }}',
repo: '${{ env.repoName }}',
workflow_id: '${{ env.workflowName }}',
ref: '${{ env.repoBranch }}',
})
# thanks to bd_, modified from this action: https://github.com/bdunderscore/modular-avatar/blob/main/.github/workflows/trigger-repo-rebuild.yml