-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
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
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 |