Update Submodule #17110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
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@v7 | |
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', | |
}) |