Fork Sync #16420
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: Fork Sync | |
on: | |
schedule: | |
- cron: '*/30 * * * *' # every 30 minutes | |
workflow_dispatch: # on button click | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Merge upstream changes | |
run: | | |
git config --global user.name "$GITHUB_ACTOR" | |
git config --global user.email "[email protected]" | |
git remote add upstream https://github.com/theos/theos.git | |
git checkout master && git fetch upstream && git merge upstream/master && git push | |
git submodule update --remote vendor/lib | |
git submodule update --remote vendor/include | |
git commit --all -m "[submodules] Update submodules to the latest commit" && git push || echo "No changes to submodules" | |
curl --fail -X PUT \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \ | |
https://api.github.com/repos/roothide/lib/actions/workflows/sync.yml/enable | |
curl --fail -X PUT \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \ | |
https://api.github.com/repos/roothide/headers/actions/workflows/sync.yml/enable | |