π update submodules #186
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 submodules | |
on: | |
schedule: | |
- cron: '0 7 * * *' | |
repository_dispatch: | |
types: [submodules] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
BRANCH: "main" | |
jobs: | |
update_submodules: | |
name: update submodules | |
runs-on: public-ledgerhq-shared-small | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
timeout-minutes: 10 | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
fetch-depth: 0 | |
token: ${{ secrets.CI_BOT_TOKEN }} | |
- name: Checkout ${{ env.BRANCH }} branch | |
timeout-minutes: 10 | |
run: git checkout ${{ env.BRANCH }} | |
- name: Get date | |
timeout-minutes: 10 | |
run: echo "CURRENT_DATE=$(date +"%Y-%m-%d %H:%M")" >> $GITHUB_ENV | |
- name: Update submodules | |
id: submodules | |
timeout-minutes: 10 | |
uses: sgoudham/[email protected] | |
- name: Check submodules changes | |
id: changes | |
timeout-minutes: 10 | |
shell: bash | |
run: | | |
git status -s | |
[[ -n "$(git status -s)" ]] && echo "changes=true" >> $GITHUB_OUTPUT || true | |
- name: Create pull request | |
if: ${{ !cancelled() && steps.changes.outputs.changes == 'true' }} | |
timeout-minutes: 10 | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.CI_BOT_TOKEN }} | |
author: ${{ secrets.CI_BOT_USERNAME }} <${{ secrets.CI_BOT_USERNAME }}@users.noreply.github.com> | |
branch: ${{ env.BRANCH }}-update-submodules | |
base: ${{ env.BRANCH }} | |
delete-branch: false | |
commit-message: 'chore: update submodules - ${{ env.CURRENT_DATE }}' | |
title: 'chore: update submodules - ${{ env.CURRENT_DATE }}' | |
body: ${{ steps.submodules.outputs.prBody }} | |
labels: submodules | |
draft: false | |
signoff: false |