Auto create tags from commit or package.json
- tokenYour- GITHUB_TOKEN. This is required. Why do we need- token? Read more here: About the GITHUB_TOKEN secret. Default:- ${{ github.token }}
- versionCreate tag for specified version. Exampe:- version: v1.0.0
- testThe regular expression matches the submitted content. Exampe:- test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
- commitThe regular expression matches the submitted content. Default:- {github.context.payload?.head_commit?.message}
- package-pathThe path of the- package.jsonfile. Default- package.json.
- releaseOptionally marks this tag as- release. Set to- trueto enable.
- prereleaseOptionally marks this release as- prerelease. Set to- trueto enable.
- draftOptionally marks this release as a- draftrelease. Set to true to enable.
- bodyAn optional body for the release.
- versionThe version number of the tag created, example:- v1.0.0.
- versionNumberThe version number of the tag created, example:- 1.0.0.
- preversionThe previous tag version number, example:- v1.0.0.
- preversionNumberThe previous tag version number of the tag created. example:- 1.0.0.
- successfulThe tag was successfully created. example:- "true".
- majorVersionMAJOR version when you make incompatible API changes.
- minorVersionMINOR version when you add functionality in a backwards compatible manner, and.
- patchVersionPATCH version when you make backwards compatible bug fixes.
- run: echo "version - ${{ steps.create_tag.outputs.version }}"
- run: echo "version || preversion - ${{ steps.create_tag.outputs.version || steps.create_tag.outputs.preversion }}"
- run: echo "versionNumber - ${{ steps.create_tag.outputs.versionNumber }}"
- run: echo "versionNumber || preversionNumber - ${{ steps.create_tag.outputs.versionNumber || steps.create_tag.outputs.preversionNumber }}"
- run: echo "majorVersion - ${{ steps.create_tag.outputs.majorVersion }}"
- run: echo "minorVersion - ${{ steps.create_tag.outputs.minorVersion }}"
- run: echo "patchVersion - ${{ steps.create_tag.outputs.patchVersion }}"
- run: echo "preversion - ${{ steps.create_tag.outputs.preversion }}"
- run: echo "successful - ${{ steps.create_tag.outputs.successful }}"Warning
In the new action, you need to add the permissions configuration:
jobs: 
  tags:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Create Tag
        id: create_tag
        uses: jaywcjlove/create-tag-action@main
        if: env.previous_tag
        with:
          test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'First, we must listen for push events
on:
  push:
    branches:
      - master
    paths-ignore:
      - '.github/**/*.yml'
      - '.gitignore'Compare the tag version number in package.json with the last tag and automatically generate tags
- run: echo "previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV
- name: Create Tag
  id: create_tag
  uses: jaywcjlove/create-tag-action@main
  if: env.previous_tag
  with:
    package-path: ./package.jsonOr, Compare the tag version number in the commit content with the last tag and automatically generate tags
- run: echo "previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV
- name: Create Tag
  id: create_tag
  uses: jaywcjlove/create-tag-action@main
  if: env.previous_tag
  with:
    test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'Use steps.<job_id>.outputs.successful to determine whether the version is created successfully, and a changelog will be automatically generated.
- name: Generate Changelog
  id: changelog
  uses: jaywcjlove/changelog-generator@main
  if: steps.create_tag.outputs.successful == 'true'
  with:
    head-ref: ${{steps.create_tag.outputs.version}}
    filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
    filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)Use steps.<job_id>.outputs.successful to determine whether the version is created successfully, the creation has been released
- name: Create Release
  uses: ncipollo/release-action@v1
  if: steps.create_tag.outputs.successful == 'true'
  with:
    allowUpdates: true
    token: ${{ secrets.GITHUB_TOKEN }}
    name: ${{ steps.create_tag.outputs.version }}
    tag: ${{ steps.create_tag.outputs.version }}
    body: |
      ```bash
      npm i @uiw/react-heat-map@${{steps.create_tag.outputs.versionNumber}}
      ```
      ${{ steps.changelog.outputs.compareurl }}
      ${{ steps.changelog.outputs.changelog }}OR use jaywcjlove/create-tag-action@main create release:
- name: Create Release
  uses: jaywcjlove/create-tag-action@main
  id: release
  if: steps.create_tag.outputs.successful == 'true'
  with:
    version: ${{steps.create_tag.outputs.version}}
    release: true
    body: |
      ```bash
      npm i @uiw/react-heat-map@${{steps.create_tag.outputs.versionNumber}}
      ```
      ${{ steps.changelog.outputs.compareurl }}
      ${{ steps.changelog.outputs.changelog }}
- name: Release Upload Assets
  uses: jaywcjlove/github-action-upload-assets@main
  continue-on-error: true
  with:
    tag: ${{ steps.release.outputs.version }}
    asset-path: '["./target/release/sgo-*"]'- Github Release Changelog Generator A GitHub Action that compares the commit differences between two branches
- Github Action Contributors Github action generates dynamic image URL for contributor list to display it!
- Generated Badges Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers)
- Create Coverage Badges Create coverage badges from coverage reports. (no 3rd parties servers)
- Github Action package Read and modify the contents of package.json.
The scripts and documentation in this project are released under the MIT License