{"id":15678000,"url":"https://github.com/jaywcjlove/create-tag-action","last_synced_at":"2025-05-07T01:48:49.570Z","repository":{"id":36972808,"uuid":"326953616","full_name":"jaywcjlove/create-tag-action","owner":"jaywcjlove","description":"Auto create tags from commit or package.json","archived":false,"fork":false,"pushed_at":"2024-04-06T11:31:03.000Z","size":2536,"stargazers_count":12,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-15T08:21:34.314Z","etag":null,"topics":["actions","create-tag","github-actions"],"latest_commit_sha":null,"homepage":"https://jaywcjlove.github.io/create-tag-action/","language":"TypeScript","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/jaywcjlove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"custom":"https://jaywcjlove.github.io/#/sponsor"}},"created_at":"2021-01-05T09:45:41.000Z","updated_at":"2024-07-31T12:57:20.585Z","dependencies_parsed_at":"2024-04-12T08:17:48.262Z","dependency_job_id":"08bb7174-bfe0-476b-87d8-e01e4dbfec4d","html_url":"https://github.com/jaywcjlove/create-tag-action","commit_stats":{"total_commits":290,"total_committers":4,"mean_commits":72.5,"dds":"0.10689655172413792","last_synced_commit":"4ab0a9ecf81779bc84c9b1ab8b3177a31828d6d3"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcreate-tag-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcreate-tag-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcreate-tag-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcreate-tag-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaywcjlove","download_url":"https://codeload.github.com/jaywcjlove/create-tag-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242503627,"owners_count":20139971,"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","create-tag","github-actions"],"created_at":"2024-10-03T16:14:48.230Z","updated_at":"2025-03-10T16:31:28.570Z","avatar_url":"https://github.com/jaywcjlove.png","language":"TypeScript","funding_links":["https://jaywcjlove.github.io/#/sponsor"],"categories":[],"sub_categories":[],"readme":"create-tag-action\n===\n\n[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)\n[![CI](https://github.com/jaywcjlove/create-tag-action/actions/workflows/create-tag.yml/badge.svg)](https://github.com/jaywcjlove/create-tag-action/actions/workflows/create-tag.yml)\n[![Repo Dependents](https://badgen.net/github/dependents-repo/jaywcjlove/create-tag-action)](https://github.com/jaywcjlove/create-tag-action/network/dependents)\n\nAuto create tags from commit or package.json\n\n## Inputs\n\n- `token` Your `GITHUB_TOKEN`. This is required. Why do we need `token`? Read more here: [About the GITHUB_TOKEN secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret). Default: `${{ github.token }}`\n- `version` Create tag for specified version. Exampe: `version: v1.0.0`\n- `test` The regular expression matches the submitted content. Exampe: `test: '[R|r]elease[d]\\s+[v|V]\\d(\\.\\d+){0,2}'`\n- `commit` The regular expression matches the submitted content. Default: `{github.context.payload?.head_commit?.message}`\n- `package-path` The path of the `package.json` file. Default `package.json`.\n- `release` Optionally marks this tag as `release`. Set to `true` to enable.\n- `prerelease` Optionally marks this release as `prerelease`. Set to `true` to enable.\n- `draft` Optionally marks this release as a `draft` release. Set to true to enable.\n- `body` An optional body for the release.\n\n## Outputs\n\n- `version` The version number of the tag created, example: `v1.0.0`.\n- `versionNumber` The version number of the tag created, example: `1.0.0`.\n- `preversion` The previous tag version number, example: `v1.0.0`.\n- `preversionNumber` The previous tag version number of the tag created. example: `1.0.0`.\n- `successful` The tag was successfully created. example: `\"true\"`.\n- `majorVersion` MAJOR version when you make incompatible API changes.\n- `minorVersion` MINOR version when you add functionality in a backwards compatible manner, and.\n- `patchVersion` PATCH version when you make backwards compatible bug fixes.\n\n```yml\n- run: echo \"version - ${{ steps.create_tag.outputs.version }}\"\n- run: echo \"version || preversion - ${{ steps.create_tag.outputs.version || steps.create_tag.outputs.preversion }}\"\n- run: echo \"versionNumber - ${{ steps.create_tag.outputs.versionNumber }}\"\n- run: echo \"versionNumber || preversionNumber - ${{ steps.create_tag.outputs.versionNumber || steps.create_tag.outputs.preversionNumber }}\"\n- run: echo \"majorVersion - ${{ steps.create_tag.outputs.majorVersion }}\"\n- run: echo \"minorVersion - ${{ steps.create_tag.outputs.minorVersion }}\"\n- run: echo \"patchVersion - ${{ steps.create_tag.outputs.patchVersion }}\"\n- run: echo \"preversion - ${{ steps.create_tag.outputs.preversion }}\"\n- run: echo \"successful - ${{ steps.create_tag.outputs.successful }}\"\n```\n\n\u003e [!WARNING]\n\u003e In the new action, you need to add the [`permissions`](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) configuration:\n\u003e \n\u003e ```yml\n\u003e jobs: \n\u003e   tags:\n\u003e     runs-on: ubuntu-latest\n\u003e     permissions:\n\u003e       contents: write\n\u003e     steps:\n\u003e       - name: Create Tag\n\u003e         id: create_tag\n\u003e         uses: jaywcjlove/create-tag-action@main\n\u003e         if: env.previous_tag\n\u003e         with:\n\u003e           test: '[R|r]elease[d]\\s+[v|V]\\d(\\.\\d+){0,2}'\n\u003e ```\n\n## Example Usage\n\nFirst, we must listen for `push` events\n\n```yml\non:\n  push:\n    branches:\n      - master\n    paths-ignore:\n      - '.github/**/*.yml'\n      - '.gitignore'\n```\n\nCompare the tag `version` number in `package.json` with the last tag and automatically generate tags\n\n```yml\n- run: echo \"previous_tag=$(git describe --tags --abbrev=0 2\u003e/dev/null || echo '')\" \u003e\u003e $GITHUB_ENV\n- name: Create Tag\n  id: create_tag\n  uses: jaywcjlove/create-tag-action@main\n  if: env.previous_tag\n  with:\n    package-path: ./package.json\n```\n\nOr, Compare the tag `version` number in the `commit content` with the last tag and automatically generate tags\n\n```yml\n- run: echo \"previous_tag=$(git describe --tags --abbrev=0 2\u003e/dev/null || echo '')\" \u003e\u003e $GITHUB_ENV\n- name: Create Tag\n  id: create_tag\n  uses: jaywcjlove/create-tag-action@main\n  if: env.previous_tag\n  with:\n    test: '[R|r]elease[d]\\s+[v|V]\\d(\\.\\d+){0,2}'\n```\n\nUse `steps.\u003cjob_id\u003e.outputs.successful` to determine whether the version is created successfully, and a changelog will be automatically generated.\n\n```yml\n- name: Generate Changelog\n  id: changelog\n  uses: jaywcjlove/changelog-generator@main\n  if: steps.create_tag.outputs.successful == 'true'\n  with:\n    head-ref: ${{steps.create_tag.outputs.version}}\n    filter-author: (jaywcjlove|小弟调调™|dependabot\\[bot\\]|Renovate Bot)\n    filter: (^[\\s]+?[R|r]elease)|(^[R|r]elease)\n```\n\nUse `steps.\u003cjob_id\u003e.outputs.successful` to determine whether the version is created successfully, the creation has been released\n\n```yml\n- name: Create Release\n  uses: ncipollo/release-action@v1\n  if: steps.create_tag.outputs.successful == 'true'\n  with:\n    allowUpdates: true\n    token: ${{ secrets.GITHUB_TOKEN }}\n    name: ${{ steps.create_tag.outputs.version }}\n    tag: ${{ steps.create_tag.outputs.version }}\n    body: |\n      ```bash\n      npm i @uiw/react-heat-map@${{steps.create_tag.outputs.versionNumber}}\n      ```\n\n      ${{ steps.changelog.outputs.compareurl }}\n      ${{ steps.changelog.outputs.changelog }}\n```\n\nOR use `jaywcjlove/create-tag-action@main` create release: \n\n```yml\n- name: Create Release\n  uses: jaywcjlove/create-tag-action@main\n  id: release\n  if: steps.create_tag.outputs.successful == 'true'\n  with:\n    version: ${{steps.create_tag.outputs.version}}\n    release: true\n    body: |\n      ```bash\n      npm i @uiw/react-heat-map@${{steps.create_tag.outputs.versionNumber}}\n      ```\n\n      ${{ steps.changelog.outputs.compareurl }}\n      ${{ steps.changelog.outputs.changelog }}\n\n- name: Release Upload Assets\n  uses: jaywcjlove/github-action-upload-assets@main\n  continue-on-error: true\n  with:\n    tag: ${{ steps.release.outputs.version }}\n    asset-path: '[\"./target/release/sgo-*\"]'\n```\n\n## See Also\n\n- [Github Release Changelog Generator](https://github.com/jaywcjlove/changelog-generator) A GitHub Action that compares the commit differences between two branches\n- [Github Action Contributors](https://github.com/jaywcjlove/github-action-contributors) Github action generates dynamic image URL for contributor list to display it!\n- [Generated Badges](https://github.com/jaywcjlove/generated-badges) Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers)\n- [Create Coverage Badges](https://github.com/jaywcjlove/coverage-badges-cli) Create coverage badges from coverage reports. (no 3rd parties servers)\n- [Github Action package](https://github.com/jaywcjlove/github-action-package) Read and modify the contents of `package.json`.\n\n## Example\n\n- [react-code-preview](https://github.com/uiwjs/react-code-preview/blob/fb9829440a21fddbb57100db62ae113be3c01161/.github/workflows/ci.yml#L35-L40)\n- [react-md-editor](https://github.com/uiwjs/react-md-editor/blob/e3293bca45bff08110ef5e9119d907db2ec95baa/.github/workflows/ci.yml#L23-L28)\n- [react-markdown-preview](https://github.com/uiwjs/react-markdown-preview/blob/b230eba6526786cbd7318e514276fd05ae58edc9/.github/workflows/ci.yml#L21-L26)\n- [react-native-uiw](https://github.com/uiwjs/react-native-uiw/blob/9876540e78df61b5c5d906451b3c76bb2168c23c/.github/workflows/ci.yml#L22-L27)\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fcreate-tag-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaywcjlove%2Fcreate-tag-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fcreate-tag-action/lists"}