-
Notifications
You must be signed in to change notification settings - Fork 231
35 lines (33 loc) · 1.04 KB
/
repo-sync.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
name: Repo Sync
on:
schedule:
- cron: "0 8 * * 1-5" # At 08:00 on every day-of-week from Monday through Friday
pull_request:
branches: [ '*' ]
paths:
- '.github/workflows/repo-sync.yml'
workflow_dispatch:
jobs:
repo-sync:
name: Repo Sync
runs-on: ubuntu-latest
env:
IS_CONFIGURED: ${{ secrets.SOURCE_REPO != '' }}
steps:
- uses: actions/checkout@v4
if: ${{ env.IS_CONFIGURED == 'true' }}
- uses: repo-sync/github-sync@v2
name: Sync repo to branch
if: ${{ env.IS_CONFIGURED == 'true' }}
with:
source_repo: ${{ secrets.SOURCE_REPO }}
source_branch: main
destination_branch: ${{ secrets.INTERMEDIATE_BRANCH }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: repo-sync/pull-request@v2
name: Create pull request
if: ${{ env.IS_CONFIGURED == 'true' }}
with:
source_branch: ${{ secrets.INTERMEDIATE_BRANCH }}
destination_branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}