REMOEV THIS SECTION ONCE THE REPO IS SET UP.
Sentry team: This repo comes with a one-time setup guide, utilities, and a GitHub Action to help you and your community build and publish codemods with ease.
- Go to Codemod Studio and sign in with your GitHub account.
- Install the Codemod app:
- In Results section of the studio, click Select Repo. That will install Codemod GitHub App on selected repos.
- Installing the app for a repo in your GitHub org automatically reserves a scope matching your org name.
- Benefit? only admins of the
getsentry
org can publish codemods starting with@getsentry
.- All official codemods appear in the Registry under that scope.
- Important: In
codemod.yaml
, the name must start with your@scope
, or it won’t show up when users filter with@getsentry
in the registry.
- Generate an API key from Codemod app.
- In your GitHub repo: Settings → Secrets & variables → actions
- Create a repository secret.
- Name:
CODEMOD_API_KEY
- Value: the key from step 1.
✅ Done! Now, after a codemod PR is merged, you can trigger a GitHub Action to auto-publish it to the Codemod Registry under your org scope. See Node.js codemods for an example.
Sentry codemods to help users adopt new features and handle breaking changes with ease.
Community contributions are welcome and appreciated! Check open issues for codemods to build, or open a new one if something’s missing. See the contribution guide for details.
Caution
Caution: Codemods modify code! Run them only on Git-tracked files, and commit or stash changes first.
Recommended for better UX, downloads the package from registry.
npx codemod@latest <codemod-name>
For example:
npx codemod@latest flatten-experiments-config
npx codemod workflow run -w /path/to/folder/containing/workflow.yaml
Note
By default, codemods run in the current folder. Add -t /target/path
to your command to change it.
See the Codemod docs for all CLI commands and options.
MIT