-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (47 loc) · 1.7 KB
/
update-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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update mirror
on:
schedule:
- cron: '0 */2 * * *'
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: upstream/master
- name: Fetch updates from official repository
run: |
git config pull.ff only
git remote add official git://git.kitenet.net/git-annex
git pull --tags official master
- name: Determine new tags
run: |
comm -23 <(git tag | sort) \
<(git ls-remote --tags --refs origin \
| awk '{print $2}' \
| xargs git for-each-ref --format '%(refname:strip=2)' \
| sort) > new-tags.txt
- name: Push new objects to mirror
run: git push --tags origin upstream/master
- name: Check out master .github
run: git checkout origin/master -- .github
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '^3.6'
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'pip-run!=8.4' wheel
# No quotes around substitution:
python -m pip install $(python -m pip_run.read-deps .github/workflows/tools/dispatch-build)
# Install the script's dependencies beforehand so that they aren't
# installed separately for each & every invocation by xargs.
- name: Trigger workflow runs for new tags
run: |
xargs -a new-tags.txt -r -L1 \
python .github/workflows/tools/dispatch-build
env:
GITHUB_TOKEN: ${{ secrets.DATALAD_GITHUB_TOKEN }}
# vim:set sts=2: