Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add codemod publish workflow #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amirabbas-gh
Copy link

📚 Description

I'm Amirabbas from Codemod.

The userland-migrations repository serves as the foundation for Node.js community codemods. It's important for the Node.js project to be able to publish these codemods under the official name — automatically and without any concerns.

At Codemod, we've developed a GitHub Actions workflow that automates publishing to the Codemod Registry. You can see the workflow in our template repository here.

I believe adding a similar publishing workflow to the userland-migrations repo would streamline contributions and improve the developer experience for the broader community.

Guide: Setting up an API key and using the publishing action

  1. Login with Codemod CLI: codemod login.
  2. Generate a Codemod API key: codemod api-keys:create.
  3. Place your API key in a repository secret under Settings > Secrets and Variables > Actions.
codemod-api-secret
  1. Create or move your codemod package(s) under the codemods or recipes directory. Note that your codemods should conform to required package structure. Additionally, make sure that your codemodrc.json file is accurate (reference).

By doing so, any change made to the main branch of your repository will automatically be published to Codemod Registry.

with:
node-version: 20

- name: Install dependencies
Copy link
Member

Choose a reason for hiding this comment

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

note we use npm

with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
Copy link
Member

Choose a reason for hiding this comment

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

so this step isn't needed

Comment on lines +69 to +70
with:
node-version: 20
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
with:
node-version: 20
with:
node-version-file: '.nvmrc'

@AugustinMauroy
Copy link
Member

You can also use https://app.stepsecurity.io/secure-workflow

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.

2 participants