https://github.com/metamask/action-utils
Utilities for GitHub Actions.
https://github.com/metamask/action-utils
Last synced: 7 months ago
JSON representation
Utilities for GitHub Actions.
- Host: GitHub
- URL: https://github.com/metamask/action-utils
- Owner: MetaMask
- License: mit
- Created: 2021-05-25T17:09:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T16:12:11.000Z (10 months ago)
- Last Synced: 2025-06-20T04:06:00.345Z (7 months ago)
- Language: TypeScript
- Size: 54.7 KB
- Stars: 5
- Watchers: 35
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# @metamask/action-utils
Utilities for MetaMask's GitHub Actions.
## Installation
`yarn add @metamask/action-utils`
or
`npm install @metamask/action-utils`
## Usage
For example:
```typescript
import {
getPackageManifest,
validatePackageManifestVersion,
} from '@metamask/action-utils';
// Partial
const rawManifest = await getPackageManifest('directory/package.json');
// Partial & { version: string }
// The version must be valid SemVer, or the function will throw.
// The manifest is returned unmodified.
const manifestWithVersion = await validatePackageManifestVersion(
rawManifest,
'directory',
);
```
For more examples of how these utilities are used, see:
- [MetaMask/action-publish-release](https://github.com/MetaMask/action-publish-release)
- [MetaMask/action-create-release-pr](https://github.com/MetaMask/action-create-release-pr)
## Testing
Run `yarn test` to run the tests once.
To run tests on file changes, run `yarn test:watch`.
## Release & Publishing
The project follows the same release process as the other libraries in the MetaMask organization:
1. Create a release branch
- For a typical release, this would be based on `main`
- To update an older maintained major version, base the release branch on the major version branch (e.g. `1.x`)
2. Update the changelog
3. Update version in package.json file (e.g. `yarn version --minor --no-git-tag-version`)
4. Create a pull request targeting the base branch (e.g. master or 1.x)
5. Code review and QA
6. Once approved, the PR is squashed & merged
7. The commit on the base branch is tagged
8. The tag can be published as needed