Skip to content

StevenJDH/action-tagger

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Action Tagger

build GitHub release (latest by date including pre-releases) Public workflows that use this action. Codacy Badge Maintenance GitHub

Action Tagger automatically sets semantic tags when releasing a new version of a GitHub action. This action adheres to GitHub's action versioning guide, and removes the tedious task of having to manually set and shift tags like v1 and v1.2 to ensure they always point to a newer release. Tags produced and managed by this action will continue to work alongside other methods for referencing a release such as pointing to a branch, SHA, or other tags to meet different needs. In fact, Action Tagger currently manages its own release tags in a very similar way as described further down.

Buy me a coffee

Features

  • Automate the setting and shifting of first and second level semantic tags.
  • Optionally set a latest tag to use as an alternative to pointing to main.
  • Tag format is validated during a run to ensure correct conformity.
  • Support for running the action in a dry run mode without making actual changes.
  • Summary reports are generated after each run.
  • Reference outputs of managed tags for additional possibilities.

Compatibility

Below is a list of GitHub-hosted runners that support jobs using this action.

Runner Supported?
Ubuntu
Windows
macOS

Inputs

The following inputs are available:

Name Type Required Default Description
enable‑dry‑run string false false Indicates whether or not to perform a dry run without pushing tags.
set‑latest‑tag string false false Indicates whether or not to also set the latest tag.
github‑token string false ${{ github.token }} Overrides the default GitHub token used to authenticate against a repository for Git context.

Note

Enabling dry run will use a dummy version of v1.0.0 regardless of what version tags are available.

Outputs

The following outputs are available:

Name Type Example Description
major_release string v1 The latest major release version.
minor_release string v1.2 The latest major and feature release version.
full_release string v1.2.3 The full release version.
latest_tag string false Indicates whether of not the latest tag was set.

Usage

Implementing this action is relatively simple with just a few steps.

  1. Below is a working example of a typical release workflow using Action Tagger. Add this to a file called something like action-release-workflow.yml, and place it in the .github/workflows/ folder. Token permissions have been scoped down to contents:write with support for pushing tags.

    name: action-release-tags
    
    on:
      release:
        types: [released, edited]
    
    jobs:
      action-tagger:
        name: action-tagger
        runs-on: ubuntu-latest
        permissions:
          contents: write
        environment: releases
    
        steps:
        - uses: actions/checkout@v4
          with:
            # Disabling shallow clone ensures all commits 
            # and tags are available at checkout.
            fetch-depth: 0
    
        - name: Tag Release
          id: action-tagger
          uses: stevenjdh/action-tagger@v1
          with:
            set-latest-tag: true
  2. When it's time to create a release, ensure that the tag being set is using the format vX.X.X. For example, v1.2.3. This will trigger the process and automate the rest.

  3. Done. Feel free to edit the release if a mistake was made, and Action Tagger will reflect the changes for this as well.

Disclaimer

Action Tagger is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributing

Thanks for your interest in contributing! There are many ways to contribute to this project. Get started here.

Do you have any questions?

Many commonly asked questions are answered in the FAQ: https://github.com/StevenJDH/action-tagger/wiki/FAQ

Want to show your support?

Method Address
PayPal: https://www.paypal.me/stevenjdh
Cryptocurrency: Supported options

// Steven Jenkins De Haro ("StevenJDH" on GitHub)