-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (54 loc) · 1.96 KB
/
sync.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Sync mirrors
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
env:
OWNER: TGAC
jobs:
repo-sync:
strategy:
fail-fast: false
matrix:
include:
- upstream_repo_owner: jameswilsenach
upstream_repo_name: FlowFI
upstream_repo_branch: main
- upstream_repo_owner: Mills33
upstream_repo_name: Basecall2Assembly
upstream_repo_branch: main
- upstream_repo_owner: Mills33
upstream_repo_name: QCPipeline
upstream_repo_branch: main
- upstream_repo_owner: apduncan
upstream_repo_name: cvanmf
upstream_repo_branch: main
name: Sync a repo from upstream
runs-on: ubuntu-latest
steps:
- name: Fork the upstream repo, if necessary
run: |
if ! git ls-remote "https://github.com/${{ env.OWNER }}/${{ matrix.upstream_repo_name }}"; then
gh repo fork "https://github.com/${{ matrix.upstream_repo_owner }}/${{ matrix.upstream_repo_name }}" --clone=false --fork-name="${{ matrix.upstream_repo_name }}" --org="${{ env.OWNER }}"
fi
env:
GH_TOKEN: ${{ secrets.PAT }}
- name: Checkout our fork
uses: actions/checkout@v4
with:
repository: ${{ env.OWNER }}/${{ matrix.upstream_repo_name }}
token: ${{ secrets.PAT }} # So we can push to it
ref: ${{ matrix.upstream_repo_branch }}
- name: Pull from the upstream repo and push to our fork
run: |
git remote add upstream "https://github.com//${{ matrix.upstream_repo_owner }}/${{ matrix.upstream_repo_name }}"
git pull upstream "${{ matrix.upstream_repo_branch}}"
git push origin "${{ matrix.upstream_repo_branch}}"
keepalive-job:
name: Keepalive workflow
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: actions/checkout@v4
- uses: gautamkrishnar/keepalive-workflow@v2