Skip to content

Commit 0fe0b46

Browse files
committed
sync use with
1 parent 313a3c5 commit 0fe0b46

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

.github/workflows/repo-sync.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
name: Repo-sync-reuse
22

3-
#secrets:
4-
# REMOTE_REPO: ${{ secrets.REMOTE_REPO }}
5-
# REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }}
6-
# PAT: ${{ secrets.PAT }}
7-
83
on:
94
#pull_request:
105
# types:
@@ -15,7 +10,7 @@ on:
1510

1611
jobs:
1712
trigger-sync:
18-
uses: vyos/.github/.github/workflows/trigger-repo-sync.yml@feature/T6349-reusable-workflows
13+
uses: sever-sever/vyos-automate/.github/workflows/trigger-repo-sync.yml@main
1914
secrets:
2015
REMOTE_REPO: ${{ secrets.REMOTE_REPO }}
2116
REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Trigger repo sync
3+
4+
on:
5+
workflow_call:
6+
secrets:
7+
REMOTE_OWNER:
8+
description: 'Remote repo owner'
9+
type: string
10+
required: true
11+
REMOTE_REPO:
12+
description: 'Remote repo name'
13+
type: string
14+
required: true
15+
PAT:
16+
description: 'Personal Access Token'
17+
type: string
18+
required: true
19+
20+
jobs:
21+
trigger-repo-sync:
22+
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
23+
runs-on: ubuntu-latest
24+
steps:
25+
26+
- name: Trigger sync workflow
27+
shell: bash
28+
env:
29+
REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }}
30+
REMOTE_REPO: ${{ secrets.REMOTE_REPO }}
31+
PAT: ${{ secrets.PAT }}
32+
run: |
33+
echo "Triggering sync workflow for ${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REPO }}"
34+
echo "Triggering sync workflow with PAT ${{ inputs.PAT }}"
35+
curl -X POST \
36+
-H "Accept: application/vnd.github.everest-preview+json" \
37+
-H "Authorization: Bearer ${{ secrets.PAT }}" \
38+
https://api.github.com/repos/${{ inputs.REMOTE_OWNER }}/${{ inputs.REMOTE_REPO }}/actions/workflows/vyos-repo-sync.yml/dispatches \
39+
-d '{"ref":"git-actions"}'

0 commit comments

Comments
 (0)