Skip to content

update-submodule

update-submodule #5

name: Update Submodule
on:
repository_dispatch:
types:
- update-submodule
jobs:
update-submodule:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.SUBUP }}
submodules: recursive
- name: Authorize Git
run: |
git config --global user.email "${{ secrets.GITMAIL }}"
git config --global user.name "${{ secrets.GITUSER }}"
- name: Update submodule
run: git submodule update --init --recursive --remote -f
- name: Check if there are changes
id: check_changes
run: echo ::set-output name=changes::$(git status --porcelain)
- name: Commit changes
if: ${{ steps.check_changes.outputs.changes != '' }}
run: |
git add .
git commit -m "Update submodule to latest commit"
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.SUBUP }}