Skip to content

Sync

Sync #101

Workflow file for this run

---
name: Sync
on:
schedule:
- cron: "17 12 * * *"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
sync:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- master
env:
upstream: https://gitlab.com/gitlab-org/docker-distribution-pruner.git
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Create target branch if missing
run: |
git checkout -b upstream-${{ matrix.branch }} \
&& git push origin upstream-${{ matrix.branch }} || :
- name: Fetch branch latest
shell: bash
run: |
git remote add upstream ${{ env.upstream }}
git remote -v
git fetch upstream ${{ matrix.branch }}
git rebase --autosquash --autostash upstream/${{ matrix.branch }}
git push --force origin upstream-${{ matrix.branch }}
gh pr create \
--title "Sync upstream branch ${{ matrix.branch }}" \
--fill-verbose \
--base "${{ matrix.branch }}" || :