{"id":13524873,"url":"https://github.com/cycjimmy/semantic-release-action","last_synced_at":"2025-05-14T13:06:01.998Z","repository":{"id":35166612,"uuid":"215775505","full_name":"cycjimmy/semantic-release-action","owner":"cycjimmy","description":"GitHub Action for Semantic Release","archived":false,"fork":false,"pushed_at":"2025-03-14T08:17:26.000Z","size":654,"stargazers_count":595,"open_issues_count":31,"forks_count":100,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T23:02:06.120Z","etag":null,"topics":["actions","github-actions","semantic-release"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/action-for-semantic-release","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cycjimmy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-10-17T11:26:28.000Z","updated_at":"2025-05-12T16:36:20.000Z","dependencies_parsed_at":"2023-01-15T15:08:19.675Z","dependency_job_id":"eaf944a6-4799-4415-94d8-d06a22aa9d7c","html_url":"https://github.com/cycjimmy/semantic-release-action","commit_stats":{"total_commits":225,"total_committers":29,"mean_commits":7.758620689655173,"dds":0.5777777777777777,"last_synced_commit":"2680a8cc390f7455782773f0c45ab113d81be7d3"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycjimmy%2Fsemantic-release-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycjimmy%2Fsemantic-release-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycjimmy%2Fsemantic-release-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycjimmy%2Fsemantic-release-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cycjimmy","download_url":"https://codeload.github.com/cycjimmy/semantic-release-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149948,"owners_count":22022851,"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":["actions","github-actions","semantic-release"],"created_at":"2024-08-01T06:01:14.161Z","updated_at":"2025-05-14T13:06:01.962Z","avatar_url":"https://github.com/cycjimmy.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Community Resources"],"sub_categories":["Deployment"],"readme":"# Semantic Release Action\n![][version-image]\n![][workflows-badge-image]\n[![Release date][release-date-image]][release-url]\n[![semantic-release][semantic-image]][semantic-url]\n[![npm license][license-image]][license-url]\n\nGitHub Action for [Semantic Release][semantic-url].\n\n## Usage\n### Step1: Set any [Semantic Release Configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration) in your repository.\n\n### Step2: [Add Secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) in your repository for the [Semantic Release Authentication](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication) Environment Variables.\n\n### Step3: Add a [Workflow File](https://help.github.com/en/articles/workflow-syntax-for-github-actions) to your repository to create custom automated processes.\n\n#### Basic Usage:\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n**IMPORTANT**: `GITHUB_TOKEN` does not have the required permissions to operate on protected branches.\nIf you are using this action for protected branches, replace `GITHUB_TOKEN` with [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). If using the `@semantic-release/git` plugin for protected branches, avoid persisting credentials as part of `actions/checkout@v4` by setting the parameter `persist-credentials: false`. This credential does not have the required permission to operate on protected branches.\n\n#### Private Packages\n\nIf you are using this action to publish to the npm [GitHub Packages Registry][github-packages-registry],\nthen make sure that you configure this in your `package.json` file:\n\n```json\n{\n  \"publishConfig\": {\n    \"registry\": \"https://npm.pkg.github.com\"\n  }\n}\n```\n\n### Inputs\n|  Input Parameter  | Required | Description                                                                                                              |\n|:-----------------:|:--------:|--------------------------------------------------------------------------------------------------------------------------|\n| semantic_version  |  false   | Specify version range for semantic-release. [[Details](#semantic_version)]                                               |\n|     branches      |  false   | The branches on which releases should happen.[[Details](#branches)]\u003cbr\u003eSupport for **semantic-release above v16**.       |\n|      branch       |  false   | The branch on which releases should happen.[[Details](#branch)]\u003cbr\u003eOnly support for **semantic-release older than v16**. |\n|   extra_plugins   |  false   | Extra plugins for pre-install. [[Details](#extra_plugins)]                                                               |\n|      dry_run      |  false   | Whether to run semantic release in `dry-run` mode. [[Details](#dry_run)]                                                 |\n|        ci         |  false   | Whether to run semantic release with CI support. [[Details](#ci)]\u003cbr\u003eSupport for **semantic-release above v16**.         |\n|   unset_gha_env   |  false   | Whether to unset the GITHUB_ACTIONS environment variable.                                                                |\n|      extends      |  false   | Use a sharable configuration [[Details](#extends)]                                                                       |\n| working_directory |  false   | Use another working directory for semantic release [[Details](#working_directory)]                                       |\n|    tag_format     |  false   | Specify format of tag (useful for monorepos)                                                                             |\n|  repository_url   |  false   | The Git repository url. If no repository url specified, current repository will be used by default.                      |\n\n#### semantic_version\n\u003e {Optional Input Parameter} Specify version range for semantic-release.\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      semantic_version: 19.0.5  # It is recommended to specify a version range\n                                # for semantic-release when using\n                                # semantic-release-action lower than @v4\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\nIf no version range is specified with `cycjimmy/semantic-release-action@v4` then [semantic-release](https://github.com/semantic-release/semantic-release/) version [21.1.1](https://github.com/semantic-release/semantic-release/releases/tag/v21.1.1) is used.\n\n#### branches\n\u003e {Optional Input Parameter} The branches on which releases should happen.\u003cbr\u003e`branches` supports for **semantic-release above v16**.\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      semantic_version: 16\n      # you can set branches for semantic-release above v16.\n      branches: |\n        [\n          '+([0-9])?(.{+([0-9]),x}).x',\n          'master',\n          'next',\n          'next-major',\n          {\n            name: 'beta',\n            prerelease: true\n          },\n          {\n            name: 'alpha',\n            prerelease: true\n          }\n        ]\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n`branches` will override the `branches` attribute in your configuration file. If the attribute is not configured on both sides, the default is:\n```\n[\n  '+([0-9])?(.{+([0-9]),x}).x',\n  'master',\n  'next',\n  'next-major',\n  {name: 'beta', prerelease: true},\n  {name: 'alpha', prerelease: true}\n]\n```\n\nSee [configuration#branches](https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches) for more information.\n\n#### branch\n\u003e {Optional Input Parameter} Similar to parameter `branches`. The branch on which releases should happen.\u003cbr\u003e`branch` only supports for **semantic-release older than v16**.\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      semantic_version: 15.13.28\n      # you can set branch for semantic-release older than v16.\n      branch: your-branch\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\nIt will override the `branch` attribute in your configuration file. If the attribute is not configured on both sides, the default is `master`.\n\n#### extra_plugins\n\u003e {Optional Input Parameter} Extra plugins for pre-install.\n\nThe action can be used with `extra_plugins` option to specify plugins which are not in the [default list of plugins of semantic release](https://semantic-release.gitbook.io/semantic-release/usage/plugins#default-plugins). When using this option, please make sure that these plugins are also mentioned in your [semantic release config's plugins](https://semantic-release.gitbook.io/semantic-release/usage/configuration#plugins) array.\n\nFor example, if you want to use `@semantic-release/git` and `@semantic-release/changelog` extra plugins, these must be added to `extra_plugins` in your actions file and `plugins` in your [release config file](https://semantic-release.gitbook.io/semantic-release/usage/configuration#configuration-file) as shown bellow:\n\nGithub Action Workflow:\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      # You can specify specifying version range for the extra plugins if you prefer.\n      extra_plugins: |\n        @semantic-release/changelog@6.0.0\n        @semantic-release/git\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\nSimilar to parameter `semantic_version`. *It is recommended to manually specify a version of semantic-release plugins to prevent errors caused.*\n\nRelease Config:\n```diff\n  plugins: [\n    .\n+   \"@semantic-release/changelog\"\n+   \"@semantic-release/git\",\n  ]\n```\n\n#### dry_run\n\u003e {Optional Input Parameter} Whether to run semantic release in `dry-run` mode.\u003cbr\u003eIt will override the dryRun attribute in your configuration file.\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      dry_run: true\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n#### ci\n\u003e {Optional Input Parameter} Whether to run semantic release with CI support (default true).\u003cbr\u003e`ci` supports for **semantic-release above v16**.\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      ci: false\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n`ci` can be used, e.g in combination with `dry_run` when generating the next release version in pull requests, where `semantic_release` would normally block the execution.\n\n#### extends\nThe action can be used with `extends` option to extend an existing [sharable configuration](https://semantic-release.gitbook.io/semantic-release/usage/shareable-configurations) of semantic-release. Can be used in combination with `extra_plugins`.\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      # You can extend an existing shareable configuration.\n      # And you can specify version range for the shareable configuration if you prefer.\n      extends: |\n        @semantic-release/apm-config@^9.0.0\n        @mycompany/override-config\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n#### working_directory\nThis action run semantic release in the github provided workspace by default. You can override it by setting another working directory.\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      # You can select another working directory like a subdirectory for example.\n      working_directory: ./code\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n#### tag_format\nThe default tag format on semantic-release is `v{version}`. You can override that behavior using this option (helpful when you are using monorepos)\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      tag_format: custom-v${version}\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n#### unset_gha_env\nSetting this to true will unset the `GITHUB_ACTIONS` environment variable. This can be useful when wanting to validate things such as merging of a PR would create a valid release.\n\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Temporarily merge PR branch\n    if: ${{ github.event_name == 'pull_request' }}\n    run: |\n      git config --global user.name github-actions\n      git config --global user.email github-actions@github.com\n      git merge --no-ff origin/${{ github.event.pull_request.head.ref }} --message \"${{ github.event.pull_request.title }}\"\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    with:\n      unset_gha_env: ${{ github.event_name == 'pull_request' }}\n      ci: ${{ github.event_name == 'pull_request' \u0026\u0026 false || '' }}\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n### Outputs\n|     Output Parameter      | Description                                                                                                                       |\n|:-------------------------:|-----------------------------------------------------------------------------------------------------------------------------------|\n|   new_release_published   | Whether a new release was published. The return value is in the form of a string. (`\"true\"` or `\"false\"`)                         |\n|    new_release_version    | Version of the new release. (e.g. `\"1.3.0\"`)                                                                                      |\n| new_release_major_version | Major version of the new release. (e.g. `\"1\"`)                                                                                    |\n| new_release_minor_version | Minor version of the new release. (e.g. `\"3\"`)                                                                                    |\n| new_release_patch_version | Patch version of the new release. (e.g. `\"0\"`)                                                                                    |\n|    new_release_channel    | The distribution channel on which the last release was initially made available (undefined for the default distribution channel). |\n|     new_release_notes     | The release notes for the new release.                                                                                            |\n| new_release_git_head      | The sha of the last commit being part of the new release |\n| new_release_git_tag       | The Git tag associated with the new release. |\n| last_release_version      | Version of the previous release, if there was one. (e.g. `1.2.0`) |\n| last_release_git_head     | The sha of the last commit being part of the last release, if there was one. |\n| last_release_git_tag      | The Git tag associated with the last release, if there was one. |                                                         |\n\n#### Using Output Variables:\n```yaml\nsteps:\n  - name: Checkout\n    uses: actions/checkout@v4\n  - name: Semantic Release\n    uses: cycjimmy/semantic-release-action@v4\n    id: semantic   # Need an `id` for output variables\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n\n  - name: Do something when a new release published\n    if: steps.semantic.outputs.new_release_published == 'true'\n    run: |\n      echo ${{ steps.semantic.outputs.new_release_version }}\n      echo ${{ steps.semantic.outputs.new_release_major_version }}\n      echo ${{ steps.semantic.outputs.new_release_minor_version }}\n      echo ${{ steps.semantic.outputs.new_release_patch_version }}\n```\n\n## Changelog\nSee [CHANGELOG][changelog-url].\n\n## License\nThis project is released under the [MIT License][license-url].\n\n\u003c!-- Links: --\u003e\n[version-image]: https://img.shields.io/github/package-json/v/cycjimmy/semantic-release-action\n\n[workflows-badge-image]: https://github.com/cycjimmy/semantic-release-action/workflows/Test%20Release/badge.svg\n\n[release-date-image]: https://img.shields.io/github/release-date/cycjimmy/semantic-release-action\n[release-url]: https://github.com/cycjimmy/semantic-release-action/releases\n\n[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-url]: https://github.com/semantic-release/semantic-release\n\n[license-image]: https://img.shields.io/npm/l/@cycjimmy/semantic-release-action.svg\n[license-url]: https://github.com/cycjimmy/semantic-release-action/blob/main/LICENSE\n\n[changelog-url]: https://github.com/cycjimmy/semantic-release-action/blob/main/docs/CHANGELOG.md\n\n[github-packages-registry]: https://github.com/features/packages\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycjimmy%2Fsemantic-release-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcycjimmy%2Fsemantic-release-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycjimmy%2Fsemantic-release-action/lists"}