Skip to content

Sync fork with upstream #351

Sync fork with upstream

Sync fork with upstream #351

Workflow file for this run

name: Sync fork with upstream
on:
workflow_dispatch: # on button click
schedule:
- cron: '30 1 * * *' # every day at 1:30 minutes
env:
UPSTREAM_URL: https://github.com/lassekongo83/adw-gtk3.git
UPSTREAM_BRANCH: main
jobs:
sync:
if: github.repository == 'ronny-rentner/adwaita-gtk3-gtk4-theme'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Show branch
run: echo "Syncing fork from $UPSTREAM_URL/$UPSTREAM_BRANCH to $GITHUB_REF"
- name: Sync latest commits from upstream repo
id: sync
run: |
git remote add upstream $UPSTREAM_URL
git fetch upstream $UPSTREAM_BRANCH
git rebase --autosquash --autostash upstream/$UPSTREAM_BRANCH
git push --force origin ${GITHUB_REF#refs/heads/}
git config --local --add safe.directory .
git push --porcelain --force origin ${GITHUB_REF#refs/heads/} | grep '\[up to date\]' && echo "release=yes" >> $GITHUB_OUTPUT
release:
needs: sync
if: ${{ success() && needs.sync.outputs.release == 'yes' }}
uses: ./.github/workflows/release.yml
secrets: inherit