π (automation): Automate the update of our toolchain #4
Workflow file for this run
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 toolchain | |
on: | |
schedule: | |
- cron: "0 0 * * 0" | |
workflow_dispatch: | |
push: | |
branches: | |
- chore/no-issue-auto-update-toolchain | |
jobs: | |
update-toolchain: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-toolchain-composite@develop | |
- name: Setup git and branch | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git checkout -b chore/update-toolchain | |
- name: Update toolchain | |
run: | | |
proto outdated --update | |
- name: Check for changes | |
id: changes | |
run: | | |
echo "status=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT | |
- name: Create PR | |
if: steps.changes.outputs.status > 0 | |
run: | | |
git add .prototools | |
git commit -m "π§ (repo) [NO-ISSUE]: Update toolchain" | |
git push origin chore/update-toolchain | |
gh pr create \ | |
--title "π§ (repo) [NO-ISSUE]: Update toolchain" \ | |
--body "This PR updates the toolchain (node, npm, pnpm) to the newest versions" \ | |
--base develop \ | |
--head chore/update-toolchain \ | |
--reviewer ledgerhq/live-devices | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |