|
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@v5 |
|
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 }} |