Skip to content

Update Submodule #23226

Update Submodule

Update Submodule #23226

name: Update Submodule
on:
workflow_dispatch:
schedule:
- cron: "10,40 * * * *"
jobs:
update-submodule:
name: Update Submodule
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true
- name: Git submodule update
run: |
git pull --rebase=true --recurse-submodules
git submodule update --remote --recursive
- name: Commit update
id: commit
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
if git commit -am "ci: update TLDR submodule" && git push; then
echo "anything-committed=true" >> $GITHUB_OUTPUT
else
echo "anything-committed=false" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Trigger Calculate Metrics
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ steps.commit.outputs.anything-committed == 'true' }}
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'calculate-metrics.yml',
ref: 'main',
})