ci: add workflow to update design-tokens version#276
Open
Conversation
Reviewer's GuideAdds a new GitHub Actions workflow to manually trigger and automate updates of the @aurodesignsystem/design-tokens package, then build the project and open a pull request with standardized metadata. Sequence diagram for the manual design-tokens update workflowsequenceDiagram
actor Maintainer
participant GitHubActions as GitHubActions_Workflow
participant Repo as Repository
participant Node as NodeJS_Environment
participant Npm as NPM
participant Ncu as NpmCheckUpdates
participant PR as GitHub_PullRequests
Maintainer->>GitHubActions: Trigger workflow_dispatch(ticket-number, change-type)
GitHubActions->>Node: Setup Node.js using actions_setup-node_v4
GitHubActions->>Repo: Checkout code using actions_checkout_v4
GitHubActions->>Npm: Run npm_ci to install dependencies
GitHubActions->>Ncu: Run npx_npm-check-updates for aurodesignsystem_design-tokens
Ncu->>Repo: Update package.json and lockfile
GitHubActions->>Npm: Run npm_run_build
GitHubActions->>PR: Create pull request using peter-evans_create-pull-request_v5
PR-->>Maintainer: New PR with standardized commit-message, title, body
Flow diagram for update-design-tokens GitHub Actions jobflowchart TD
A["workflow_dispatch triggered
inputs: ticket-number, change-type"] --> B["Job update-design-tokens starts
runs-on ubuntu-latest"]
B --> C["Set permissions
contents: write
pull-requests: write"]
C --> D["Install Node.js
actions_setup-node_v4"]
D --> E["Checkout repository
actions_checkout_v4"]
E --> F["Install dependencies
npm ci"]
F --> G["Update design tokens
npx npm-check-updates -f @aurodesignsystem/design-tokens -u --install always"]
G --> H["Build project
npm run build"]
H --> I["Create pull request
peter-evans_create-pull-request_v5
commit-message uses change-type and ticket-number
branch: update-tokens with timestamp suffix"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In the
actions/setup-node@v4step, consider explicitly specifying anode-versionto ensure consistent runtime behavior across runs and avoid surprises when the default version changes. - The
update design-tokensstep currently usesnpx npm-check-updateswithout a fixed version; consider pinningnpm-check-updatesto a specific major/minor version to avoid workflow breakage from upstream changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the `actions/setup-node@v4` step, consider explicitly specifying a `node-version` to ensure consistent runtime behavior across runs and avoid surprises when the default version changes.
- The `update design-tokens` step currently uses `npx npm-check-updates` without a fixed version; consider pinning `npm-check-updates` to a specific major/minor version to avoid workflow breakage from upstream changes.
## Individual Comments
### Comment 1
<location> `.github/workflows/update-design-tokens.yml:29-30` </location>
<code_context>
+ contents: write
+ pull-requests: write
+ steps:
+ - name: Install Node.js
+ uses: actions/setup-node@v4
+ - name: Clone repo
+ uses: actions/checkout@v4
</code_context>
<issue_to_address>
**suggestion:** Specify an explicit Node.js version to avoid future breakages from environment changes
The workflow currently uses the default Node version from `actions/setup-node@v4`. To keep builds reproducible and avoid surprises when GitHub changes that default, set an explicit version via `with: node-version: '18.x'` (or your project’s standard). This also documents the expected runtime for future maintainers.
```suggestion
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alaska Airlines Pull Request
Resolves: # (issue, if applicable)
Summary:
This pull request introduces a new GitHub Actions workflow to automate updating the
design-tokenspackage. The workflow allows users to manually trigger updates, specify the type of change, and associate updates with a ticket number. It streamlines the process of keeping design tokens up to date and ensures changes are properly tracked.New workflow for updating design tokens:
.github/workflows/update-design-tokens.ymlto automate updating the@aurodesignsystem/design-tokenspackage, including steps for installing dependencies, updating the package, building the project, and creating a pull request with customizable commit messages and titles.Please delete options that are not relevant.
Checklist:
By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.
Thank you for your submission!
-- Auro Design System Team
Summary by Sourcery
CI: