{"id":13485100,"url":"https://github.com/changesets/action","last_synced_at":"2025-05-14T01:11:29.903Z","repository":{"id":37735073,"uuid":"202093906","full_name":"changesets/action","owner":"changesets","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-10T11:25:49.000Z","size":4194,"stargazers_count":803,"open_issues_count":194,"forks_count":298,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-05-10T11:28:40.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/changesets.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-08-13T07:57:58.000Z","updated_at":"2025-05-10T11:25:24.000Z","dependencies_parsed_at":"2024-02-19T16:11:21.097Z","dependency_job_id":"05fff2d4-ac11-44e4-b627-8f5ff95fb503","html_url":"https://github.com/changesets/action","commit_stats":{"total_commits":133,"total_committers":33,"mean_commits":4.03030303030303,"dds":0.6691729323308271,"last_synced_commit":"c62ef9792fd0502c89479ed856efe28575010472"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changesets%2Faction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changesets%2Faction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changesets%2Faction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changesets%2Faction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/changesets","download_url":"https://codeload.github.com/changesets/action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254049438,"owners_count":22006060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:45.896Z","updated_at":"2025-05-14T01:11:24.893Z","avatar_url":"https://github.com/changesets.png","language":"TypeScript","readme":"# Changesets Release Action\n\nThis action for [Changesets](https://github.com/atlassian/changesets) creates a pull request with all of the package versions updated and changelogs updated and when there are new changesets on [your configured `baseBranch`](https://github.com/changesets/changesets/blob/main/docs/config-file-options.md#basebranch-git-branch-name), the PR will be updated. When you're ready, you can merge the pull request and you can either publish the packages to npm manually or setup the action to do it for you.\n\n## Usage\n\n### Inputs\n\n- publish - The command to use to build and publish packages\n- version - The command to update version, edit CHANGELOG, read and delete changesets. Default to `changeset version` if not provided\n- commit - The commit message to use. Default to `Version Packages`\n- title - The pull request title. Default to `Version Packages`\n- setupGitUser - Sets up the git user for commits as `\"github-actions[bot]\"`. Default to `true`\n- createGithubReleases - A boolean value to indicate whether to create Github releases after `publish` or not. Default to `true`\n- cwd - Changes node's `process.cwd()` if the project is not located on the root. Default to `process.cwd()`\n\n### Outputs\n\n- published - A boolean value to indicate whether a publishing has happened or not\n- publishedPackages - A JSON array to present the published packages. The format is `[{\"name\": \"@xx/xx\", \"version\": \"1.2.0\"}, {\"name\": \"@xx/xy\", \"version\": \"0.8.9\"}]`\n\n### Example workflow:\n\n#### Without Publishing\n\nCreate a file at `.github/workflows/release.yml` with the following content.\n\n```yml\nname: Release\n\non:\n  push:\n    branches:\n      - main\n\nconcurrency: ${{ github.workflow }}-${{ github.ref }}\n\njobs:\n  release:\n    name: Release\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v3\n\n      - name: Setup Node.js 20\n        uses: actions/setup-node@v3\n        with:\n          node-version: 20\n\n      - name: Install Dependencies\n        run: yarn\n\n      - name: Create Release Pull Request\n        uses: changesets/action@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### With Publishing\n\nBefore you can setup this action with publishing, you'll need to have an [npm token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens) that can publish the packages in the repo you're setting up the action for and doesn't have 2FA on publish enabled ([2FA on auth can be enabled](https://docs.npmjs.com/about-two-factor-authentication)). You'll also need to [add it as a secret on your GitHub repo](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) with the name `NPM_TOKEN`. Once you've done that, you can create a file at `.github/workflows/release.yml` with the following content.\n\n```yml\nname: Release\n\non:\n  push:\n    branches:\n      - main\n\nconcurrency: ${{ github.workflow }}-${{ github.ref }}\n\njobs:\n  release:\n    name: Release\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v3\n\n      - name: Setup Node.js 20.x\n        uses: actions/setup-node@v3\n        with:\n          node-version: 20.x\n\n      - name: Install Dependencies\n        run: yarn\n\n      - name: Create Release Pull Request or Publish to npm\n        id: changesets\n        uses: changesets/action@v1\n        with:\n          # This expects you to have a script called release which does a build for your packages and calls changeset publish\n          publish: yarn release\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n\n      - name: Send a Slack notification if a publish happens\n        if: steps.changesets.outputs.published == 'true'\n        # You can do something when a publish happens.\n        run: my-slack-bot send-notification --message \"A new version of ${GITHUB_REPOSITORY} was published!\"\n```\n\nBy default the GitHub Action creates a `.npmrc` file with the following content:\n\n```\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n```\n\nHowever, if a `.npmrc` file is found, the GitHub Action does not recreate the file. This is useful if you need to configure the `.npmrc` file on your own.\nFor example, you can add a step before running the Changesets GitHub Action:\n\n```yml\n- name: Creating .npmrc\n  run: |\n    cat \u003c\u003c EOF \u003e \"$HOME/.npmrc\"\n      //registry.npmjs.org/:_authToken=$NPM_TOKEN\n    EOF\n  env:\n    NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n#### Custom Publishing\n\nIf you want to hook into when publishing should occur but have your own publishing functionality, you can utilize the `hasChangesets` output.\n\nNote that you might need to account for things already being published in your script because a commit without any new changesets can always land on your base branch after a successful publish. In such a case you need to figure out on your own how to skip over the actual publishing logic or handle errors gracefully as most package registries won't allow you to publish over already published version.\n\n```yml\nname: Release\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  release:\n    name: Release\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v3\n\n      - name: Setup Node.js 20.x\n        uses: actions/setup-node@v3\n        with:\n          node-version: 20.x\n\n      - name: Install Dependencies\n        run: yarn\n\n      - name: Create Release Pull Request or Publish to npm\n        id: changesets\n        uses: changesets/action@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Publish\n        if: steps.changesets.outputs.hasChangesets == 'false'\n        # You can do something when a publish should happen.\n        run: yarn publish\n```\n\n#### With version script\n\nIf you need to add additional logic to the version command, you can do so by using a version script.\n\nIf the version script is present, this action will run that script instead of `changeset version`, so please make sure that your script calls `changeset version` at some point. All the changes made by the script will be included in the PR.\n\n```yml\nname: Release\n\non:\n  push:\n    branches:\n      - main\n\nconcurrency: ${{ github.workflow }}-${{ github.ref }}\n\njobs:\n  release:\n    name: Release\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v3\n\n      - name: Setup Node.js 20.x\n        uses: actions/setup-node@v3\n        with:\n          node-version: 20.x\n\n      - name: Install Dependencies\n        run: yarn\n\n      - name: Create Release Pull Request\n        uses: changesets/action@v1\n        with:\n          # this expects you to have a npm script called version that runs some logic and then calls `changeset version`.\n          version: yarn version\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### With Yarn 2 / Plug'n'Play\n\nIf you are using [Yarn Plug'n'Play](https://yarnpkg.com/features/pnp), you should use a custom `version` command so that the action can resolve the `changeset` CLI:\n\n```yaml\n- uses: changesets/action@v1\n  with:\n    version: yarn changeset version\n    ...\n```\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchangesets%2Faction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchangesets%2Faction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchangesets%2Faction/lists"}