Update Fork #529
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 Fork | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
auto-update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PAT }} # So that the workflow triggers on fork update | |
- uses: fregante/setup-git-user@v2 | |
- name: Check if fork is synced with upstream | |
id: check_sync | |
uses: MadLadSquad/[email protected] | |
with: | |
upstream-url: "https://github.com/iJSD-Org/IacDiscordNotifs" | |
first-branch: main | |
second-branch: main | |
- name: Rebase on top of base branch | |
if: steps.check_sync.outputs.behind > 0 | |
run: | | |
git remote add upstream https://github.com/iJSD-Org/IacDiscordNotifs | |
git fetch upstream | |
git rebase upstream/main | |
git commit --amend --no-edit | |
git push -f |