Periodic Repo Update #1459
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
# This is a basic workflow to help you get started with Actions | |
name: Periodic Repo Update | |
# Controls when the workflow will run | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Setting up the environment | |
- name: setup | |
run: | | |
git config --global user.name 'Wheel-Next Github Bot' | |
git config --global user.email '[email protected]' | |
git config --global credential.helper store | |
echo "https://x-access-token:${{ secrets.CI_TOKEN }}@github.com" > ~/.git-credentials | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.CI_TOKEN }} | |
submodules: true | |
ref: refs/heads/main | |
# Update references | |
- name: Git Submodule Update | |
run: | | |
git pull --recurse-submodules | |
git submodule update --remote --recursive | |
git submodule foreach 'if [ "$name" = "mockhouse" ]; then git pull origin server; else git pull origin main; fi' | |
# Upload the update to github | |
- name: Commit update | |
run: | | |
git remote set-url origin https://x-access-token:${{ secrets.CI_TOKEN }}@github.com/${{ github.repository }} | |
git commit -am "Auto updated submodule references" && git push || echo "No changes to commit" |