mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
37 lines
1.0 KiB
YAML
37 lines
1.0 KiB
YAML
name: Update submodules
|
|
on:
|
|
schedule: [{cron: 0 3 * * *}]
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: write
|
|
issues: write
|
|
pull-requests: write
|
|
jobs:
|
|
update-submodules:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
fetch-depth: 0
|
|
token: ${{secrets.GITHUB_TOKEN}}
|
|
- name: Config Git User
|
|
run: |
|
|
git config --global user.name "${{ github.actor }}"
|
|
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
|
- name: Update submodules
|
|
run: |
|
|
if git commit -am"chore(git): Update submodules (automated)
|
|
|
|
$(git submodule --quiet foreach \
|
|
'tag="$(git describe --tags --abbrev=0 origin/HEAD)"
|
|
if [ "$(git describe --tags)" != "$tag" ]; then
|
|
git checkout --quiet "$tag"
|
|
echo "$name" "$tag"
|
|
fi')"
|
|
then
|
|
git show --raw
|
|
git push
|
|
fi
|