-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.25 KB
/
mirror.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
36
37
38
39
40
41
42
43
name: Mirror repositories
on:
workflow_dispatch:
schedule:
- cron: '11 1/6 * * *'
concurrency:
group: ${{ github.workflow }}
jobs:
mirror:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repository: elpa
mirror: false
- repository: nongnu
mirror: false
- repository: org-mode
mirror: true
steps:
- name: Configure
id: config
run: |
if [[ ${{ matrix.mirror }} = true ]]; then
echo >> "$GITHUB_OUTPUT" working_dir=${{ matrix.repository }}.git
echo >> "$GITHUB_OUTPUT" flag=--mirror
else
echo >> "$GITHUB_OUTPUT" working_dir=${{ matrix.repository }}
echo >> "$GITHUB_OUTPUT" flag=
fi
- name: Clone
run: |
git clone ${{ steps.config.outputs.flag }} \
https://git.savannah.gnu.org/git/emacs/${{ matrix.repository }}.git
- name: Push
working-directory: ${{ steps.config.outputs.working_dir }}
run: |
git remote set-url --push origin https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository_owner }}/${{ matrix.repository }}.git
git push --force origin --all