Skip to content

jimeh/update-tags-action

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

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

update-tags-action

Easily create/update one or more Git tags in a GitHub repository.

Latest Release GitHub Issues GitHub Pull Requests License

Generally useful for moving major (v1) and minor (v1.2) tags to same commit as the latest v1.x.x tag.

This action uses itself to move its own major and minor tags.

Examples

Basic

- uses: jimeh/update-tags-action@v2
  with:
    tags: v2,v2.2
- uses: jimeh/update-tags-action@v2
  with:
    tags: |
      v2
      v2.2

With Release Please

This example uses jimeh/release-please-manifest-action, but you can just as easily use the official google-github-actions/release-please-action instead.

First you'll want the workflow setup to run on push:

on: [push]

Then you'll want a release-please job which only runs on pushes to your main branch, and exposes relevant outputs from release please:

jobs:
  # [...]
  release-please:
    runs-on: ubuntu-latest
    if: ${{ github.ref == 'refs/heads/main' }}
    outputs:
      release_created: ${{ steps.release-please.outputs.release_created }}
      major: ${{ steps.release-please.outputs.major }}
      minor: ${{ steps.release-please.outputs.minor }}
    permissions:
      contents: write
      issues: write
      pull-requests: write
    steps:
      - uses: jimeh/release-please-manifest-action@v3
        id: release-please

And finally a job to create MAJOR and MINOR release tags, which only runs when release-please reports having created a release:

jobs:
  # [...]
  release-tags:
    runs-on: ubuntu-latest
    needs: release-please
    if: ${{ needs.release-please.outputs.release_created }}
    permissions:
      contents: write
    steps:
      - uses: jimeh/update-tags-action@v2
        with:
          tags: |
            v${{ needs.release-please.outputs.major }}
            v${{ needs.release-please.outputs.major }}.${{ needs.release-please.outputs.minor }}

Inputs

name description required default
tags

List/CSV of tags to create/update.

true ""
ref

The SHA or ref to tag. Defaults to SHA of current commit.

false ${{ github.sha }}
when_exists

What to do if the tag already exists. Must be one of 'update', 'skip', or 'fail'.

false update
annotation

Optional annotation message for tags. If provided, creates annotated tags. If empty, creates lightweight tags.

false ""
github_token

The GitHub token to use for authentication.

false ${{ github.token }}

Outputs

name description
tags

List of tags that were created/updated.

created

List of tags that were created.

updated

List of tags that were updated.

skipped

List of tags that were skipped.

Runs

This action is a node24 action.

License

MIT

About

Easily create/update one or more Git tags in a GitHub repository.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •