forked from wikimedia/mediawiki-tools-grabbers
-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (33 loc) · 1.02 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: 'Sync with upstream'
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
repo-sync:
name: Repo Sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: repo-sync/github-sync@v2
name: Sync repo to branch
with:
source_repo: wikimedia/mediawiki-tools-grabbers
source_branch: master
destination_branch: weirdgloop/repo-sync
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check for changes
run: |
if [ "$(git rev-parse --revs-only origin/weirdgloop/repo-sync)" != "$(git merge-base $GITHUB_REF_NAME origin/weirdgloop/repo-sync)" ]; then
echo changes_exist=true >> $GITHUB_ENV
fi
- uses: repo-sync/pull-request@v2
name: Create pull request
if: env.changes_exist == 'true'
with:
source_branch: weirdgloop/repo-sync
destination_branch: weirdgloop/main
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Sync with upstream"