JOJ3/.gitea/workflows/submodule.yaml
张泊明518370910136 32ff1059ab
All checks were successful
build / build (push) Successful in 2m4s
submodules sync / sync (push) Successful in 30s
build / build (pull_request) Successful in 1m47s
build / trigger-build-image (push) Has been skipped
build / trigger-build-image (pull_request) Has been skipped
ci(submodule): show status
2024-10-08 17:01:54 -04:00

38 lines
1.3 KiB
YAML

---
name: submodules sync
on:
push:
branches:
- submodule
jobs:
sync:
container:
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
volumes:
- /home/actions/.ssh:/root/.ssh
steps:
- name: Check out repository code
uses: https://gitea.com/BoYanZh/checkout@focs
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.name "gitea-actions[bot]"
git config --global user.email "gitea-actions[bot]@users.noreply.gitea.com"
chown -R root:root /root/.ssh
- name: Git Submodule Update
run: |
git submodule init
git submodule update --init --recursive
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Commit update
run: |
git status
git submodule status
git commit -am "chore: update submodule references"
git status
git submodule status
git push || echo "No changes to commit"