forked from Uninett/Argus
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.23 KB
/
trigger-argus-docker.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 workflow in argus-docker on release
on:
release:
types: ["released"]
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Generate an installation access token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "argus-docker"
- name: Trigger Workflow in argus-docker
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
repo_owner="Uninett"
repo_name="argus-docker"
event_type="trigger-release"
repository="${{ github.event.repository.name }}"
version="${{ github.event.release.tag_name }}"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ env.GH_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \
\"client_payload\": {\"repository\": \"$repository\", \"version\": \"$version\"}}"