Skip to content

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Mar 13, 2025

Explanation

This updates all workflows to remove the use of actions/checkout, actions/setup-node, actions/cache. The implementation here is based on MetaMask/snaps#3214.

References

MetaMask-planning#3925.

Changelog

n/a, this doesn't make any changes to packages directly.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@Mrtenz Mrtenz force-pushed the mrtenz/update-workflows branch from a06c737 to 4d31eab Compare March 13, 2025 19:14
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@Mrtenz Mrtenz marked this pull request as ready for review March 13, 2025 19:21
@Mrtenz Mrtenz requested a review from a team as a code owner March 13, 2025 19:21
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you for doing this!

@Mrtenz Mrtenz force-pushed the mrtenz/update-workflows branch from 51052a6 to 5d9661d Compare March 14, 2025 15:14
@Mrtenz Mrtenz enabled auto-merge (squash) March 14, 2025 15:15
@Mrtenz Mrtenz merged commit 8e2855c into main Mar 14, 2025
181 checks passed
@Mrtenz Mrtenz deleted the mrtenz/update-workflows branch March 14, 2025 15:19
georgewrmarshall added a commit to MetaMask/metamask-design-system that referenced this pull request Mar 20, 2025
## Description

This updates all workflows to remove the use of `actions/checkout`,
`actions/setup-node`, `actions/cache`. The implementation here is based
on MetaMask/core#5474

Key improvements:
1. Replaces manual Node.js setup and caching with a standardized action
2. Adds proper high-risk environment handling for sensitive workflows
3. Updates Node.js version matrix to include v22.x
4. Improves security by removing potentially vulnerable caching
mechanisms

## Related issues

Fixes: #377
-
https://github.com/MetaMask/metamask-design-system/security/code-scanning/3
-
https://github.com/MetaMask/metamask-design-system/security/code-scanning/2
-
https://github.com/MetaMask/metamask-design-system/security/code-scanning/1

## Manual testing steps

1. Review the changes MetaMask/core#5474 and
make sure it matches in this PR in each workflow:
   - `.github/workflows/lint-build-test.yml`
   - `.github/workflows/publish-release.yml`
   - `.github/workflows/publish-preview.yml`
   - `.github/workflows/ensure-blocking-pr-labels-absent.yml`
   - `.github/workflows/security-code-scanner.yml`
   - `.github/workflows/main.yml`

2. Verify that the workflows use the correct configuration:
   ```yaml
   - name: Checkout and setup environment
     uses: MetaMask/action-checkout-and-setup@v1
     with:
       is-high-risk-environment: true  # for publish workflows
       node-version: ${{ matrix.node-version }}  # when using matrix
   ```

3. Confirm CI passes on this PR with the updated workflows

4. For publish workflows, verify:
   - High-risk environment flag is set to `true`
   - Artifact handling is properly configured
- Node.js matrix strategy includes all required versions (18.x, 20.x,
22.x)

## Screenshots/Recordings

### After

Comparing code changes between this PR and the one in core
MetaMask/core#5474



https://github.com/user-attachments/assets/dfda14a7-2c90-4f12-bab5-ac78413552c3



## Pre-merge author checklist

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR

## Pre-merge reviewer checklist

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed)
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots
github-merge-queue bot pushed a commit to MetaMask/accounts that referenced this pull request Jun 18, 2025
…sk/action-checkout-and-setup` instead (#297)

This updates all workflows to remove the use of `actions/setup-node`,
`actions/cache` and some `actions/checkout` usages. The implementation
here is based on:
- MetaMask/core#5474
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants