Update mirror #17640
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |