-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
313a3c5
commit a7c3b60
Showing
2 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
name: Trigger repo sync | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
REMOTE_OWNER: | ||
description: 'Remote repo owner' | ||
type: string | ||
required: true | ||
REMOTE_REPO: | ||
description: 'Remote repo name' | ||
type: string | ||
required: true | ||
PAT: | ||
description: 'Personal Access Token' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
trigger-repo-sync: | ||
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Trigger sync workflow | ||
shell: bash | ||
env: | ||
REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }} | ||
REMOTE_REPO: ${{ secrets.REMOTE_REPO }} | ||
PAT: ${{ secrets.PAT }} | ||
run: | | ||
echo "Triggering sync workflow for ${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REPO }}" | ||
echo "Triggering sync workflow with PAT ${{ inputs.PAT }}" | ||
curl -X POST \ | ||
-H "Accept: application/vnd.github.everest-preview+json" \ | ||
-H "Authorization: Bearer ${{ secrets.PAT }}" \ | ||
https://api.github.com/repos/${{ inputs.REMOTE_OWNER }}/${{ inputs.REMOTE_REPO }}/actions/workflows/vyos-repo-sync.yml/dispatches \ | ||
-d '{"ref":"git-actions"}' |