Skip to content

Pull Submodules & Repackage #7

Pull Submodules & Repackage

Pull Submodules & Repackage #7

Workflow file for this run

name: Pull Submodules & Repackage
on:
schedule:
- cron: '50 18 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "Osirys"
git config pull.ff only
- name: Pull latest changes for the main repo
run: git pull origin $(git branch --show-current) || echo "Failed to pull latest changes"
- name: Update submodules to the latest commit
run: |
git submodule update --init --recursive --depth=1 # Initialize all submodules first
git submodule foreach --recursive 'git checkout $(git rev-parse --abbrev-ref HEAD) && git pull --depth=1 origin || echo "Failed to update submodule"'
- name: Commit and push submodule changes
run: git diff --quiet && git diff --staged --quiet || (git add . && git commit -m "Updated submodules" && git push --force-with-lease || echo "Push failed")