Skip to content

GitHub Actions drive me nuts. #3

GitHub Actions drive me nuts.

GitHub Actions drive me nuts. #3

name: Update Submodules
on:
push:
branches:
- main # Adjust this branch name as needed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
jobs:
update:
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
# Checkout the repository to the GitHub Actions runner

Check failure on line 23 in .github/workflows/Update Submodules.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/Update Submodules.yml

Invalid workflow file

You have an error in your yaml syntax on line 23
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.CI_TOKEN }}
submodules: true
- name: Generate Change Log
id: generate_changelog
run: |
# Generate change logs for all submodules
changelog=$(git submodule foreach 'git log --pretty=format:"%an: %s" HEAD..origin/main')
echo "$changelog"
echo "changelog=$changelog" >> $GITHUB_OUTPUT
- name: Update Submodules
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Commit Change Log
run: |
git config --global user.name 'Git bot'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "${{ steps.generate_changelog.outputs.changelog }}" && git push || echo "No changes to commit"