Home

Awesome

Detect and Tag New Version test-status

This action allows you to detect a new version of your repository based on some change in its contents between commits, creating a git tag if a new version is detected.

For example, in a JavaScript repo, you could detect that the version field in package.json had changed from "1.0.0" to "1.1.0" and therefore create a v1.1.0 tag from the current commit.

Usage

The configuration below would create a new version tag in your repository any time the contents of a current-version.txt file changed.

Note: since this action examines your git history to detect changes, you must set a fetch-depth of at least 2 with actions/checkout for that history to be present.

# ...
jobs:
  tag-new-versions:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 2
      - uses: salsify/action-detect-and-tag-new-version@v2
        with:
          version-command: |
            cat current-version.txt

Inputs

All inputs are optional.

Outputs

Version Determination

If no version-command input is provided, this action will attempt to do something sensible by default.

The logic for this detection and the corresponding version commands used can be found in determine-version.ts.