Skip to content

Commit

Permalink
Bot for bumping next deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dskloetd committed Jul 15, 2024
1 parent a19de08 commit 856ce96
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/update-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# A GitHub Actions workflow that can be used to trigger updates of npm package
# dependencies.
name: Update next npm package dependencies
on:
workflow_dispatch:
inputs:
gix_components:
description: 'Update gix-components'
default: true
type: boolean
ic_js:
description: 'Update ic-js'
default: true
type: boolean
jobs:
update-next-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install latest npm
run: npm install -g npm@latest
- name: Update gix-components
if: ${{ inputs.gix_components }}
run: |
cd frontend
npm run update:gix
git commit -a -m "Bump gix-components"
- name: Update ic-js
if: ${{ inputs.ic_js }}
run: |
cd frontend
npm run upgrade:next
git commit -a -m "Bump ic-js"
- name: Create Pull Request
id: cpr
# Note: If there were no changes, this step creates no PR.
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GIX_CREATE_PR_PAT }}
commit-message: Bump
committer: GitHub <[email protected]>
author: gix-bot <[email protected]>
branch: bot-bump-next
branch-suffix: timestamp
reviewers: mstrasinskis, dskloetd
add-paths: |
frontend
delete-branch: true
title: 'bot: Bump'
body: |
# Motivation
We want to pull in the latest changes.
We would like to render all the latest proposal types.
Even with no changes, just updating the reference is good practice.
# Changes
${{ inputs.gix_components && '* Ran `npm run update:gix`' || '' }}
${{ inputs.ic_js && '* Ran `npm run upgrade:next' || '' }}
# Tests
* CI should pass
* The pulled in changes should have been tested before being committed to their repositories.
- name: Report on the action
run: |
(
if test -n "${{ steps.cpr.outputs.pull-request-number }}"
then echo "Created [PR #${{ steps.cpr.outputs.pull-request-number }}](${{ steps.cpr.outputs.pull-request-url }})."
else echo "No changes needed."
fi
) | tee -a $GITHUB_STEP_SUMMARY

0 comments on commit 856ce96

Please sign in to comment.