File tree Expand file tree Collapse file tree 2 files changed +40
-6
lines changed Expand file tree Collapse file tree 2 files changed +40
-6
lines changed Original file line number Diff line number Diff line change 1
1
name : Repo-sync-reuse
2
2
3
- # secrets:
4
- # REMOTE_REPO: ${{ secrets.REMOTE_REPO }}
5
- # REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }}
6
- # PAT: ${{ secrets.PAT }}
7
-
8
3
on :
9
4
# pull_request:
10
5
# types:
15
10
16
11
jobs :
17
12
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
19
14
secrets :
20
15
REMOTE_REPO : ${{ secrets.REMOTE_REPO }}
21
16
REMOTE_OWNER : ${{ secrets.REMOTE_OWNER }}
Original file line number Diff line number Diff line change
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"}'
You can’t perform that action at this time.
0 commit comments