Skip to content

Commit 49e38a1

Browse files
authored
only execute repo-sync if it was configured (#5)
1 parent a109eca commit 49e38a1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/repo-sync.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,29 @@ name: Repo Sync
22

33
on:
44
schedule:
5-
- cron: "*/15 * * * *" # every 15 minutes
5+
- cron: "0 8 * * 1-5" # At 08:00 on every day-of-week from Monday through Friday
6+
workflow_dispatch:
67

78
jobs:
89
repo-sync:
910
name: Repo Sync
1011
runs-on: ubuntu-latest
12+
env:
13+
IS_CONFIGURED: ${{ secrets.SOURCE_REPO != '' }}
1114
steps:
1215
- uses: actions/checkout@v3
16+
if: ${{ env.IS_CONFIGURED == 'true' }}
1317
- uses: repo-sync/github-sync@v2
1418
name: Sync repo to branch
19+
if: ${{ env.IS_CONFIGURED == 'true' }}
1520
with:
1621
source_repo: ${{ secrets.SOURCE_REPO }}
1722
source_branch: main
1823
destination_branch: ${{ secrets.INTERMEDIATE_BRANCH }}
1924
github_token: ${{ secrets.GITHUB_TOKEN }}
2025
- uses: repo-sync/pull-request@v2
2126
name: Create pull request
27+
if: ${{ env.IS_CONFIGURED == 'true' }}
2228
with:
2329
source_branch: ${{ secrets.INTERMEDIATE_BRANCH }}
2430
destination_branch: main

0 commit comments

Comments
 (0)