From 783dc47963a193e2b2f8caf70a9b18eacd26c381 Mon Sep 17 00:00:00 2001 From: wolfcomp Date: Tue, 10 Jan 2023 22:40:52 +0100 Subject: [PATCH] add schedule to check ClientStructs for updates --- .github/workflows/update-submodules.yml | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/update-submodules.yml diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml new file mode 100644 index 000000000..b32272395 --- /dev/null +++ b/.github/workflows/update-submodules.yml @@ -0,0 +1,46 @@ +name: Submodule daily check +on: + schedule: + - cron: "0 0 */1 * *" + workflow_dispatch: + +jobs: + check: + name: Submodule check + runs-on: ubuntu-latest + strategy: + matrix: + branches: [master] + + defaults: + run: + shell: bash + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + ref: ${{ matrix.branches }} + token: ${{ secrets.PAT }} + - name: Create update branch + run: git checkout -b csupdate/${{ matrix.branches }} + - name: Initialize mandatory git config + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email noreply@github.com + git config --global pull.rebase false + - name: Update submodule + run: | + git checkout -b csupdate-${{ matrix.branches }} + cd lib/FFXIVClientStructs + git fetch + git reset --hard origin/main + cd ../.. + git add lib/FFXIVClientStructs + git commit --message "Update ClientStructs" + git push origin csupdate-${{ matrix.branches }} + - name: Create PR + run: | + echo ${{ secrets.PAT }} | gh auth login --with-token + gh pr create --head csupdate-${{ matrix.branches }} --title "Update ClientStructs" --body "" --base ${{ matrix.branches }}