Skip to content

Commit 119ab3c

Browse files
authored
Create trigger-private-automation.yml
1 parent c8c3d30 commit 119ab3c

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Trigger private automation (repo A)
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
dispatch:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Dispatch workflow in repo A
12+
env:
13+
PAT: ${{ secrets.DISPATCH_PAT }}
14+
TAG: ${{ github.event.release.tag_name }}
15+
RELEASE_ID: ${{ github.event.release.id }}
16+
shell: bash
17+
run: |
18+
set -euo pipefail
19+
20+
# repo A 워크플로 파일명(아래 repo A에 만들 파일명과 동일하게)
21+
WORKFLOW_FILE="sync-from-repoB.yml"
22+
23+
curl -sS -X POST \
24+
-H "Authorization: token ${PAT}" \
25+
-H "Accept: application/vnd.github+json" \
26+
"https://api.github.com/repos/clcocd/DC-AutoWriteProject/actions/workflows/${WORKFLOW_FILE}/dispatches" \
27+
-d "{\"ref\":\"main\",\"inputs\":{\"tag\":\"${TAG}\",\"release_id\":\"${RELEASE_ID}\"}}" \
28+
> /dev/null

0 commit comments

Comments
 (0)