Skip to content

Automated floating tag creation #53

@rartych

Description

@rartych

Problem description
v0 tag is used to reference the latest released version of reusable workflows.
Many projects automate this.

Possible evolution
The workflow like this can automatically update the v0 tag:

name: Update floating tags
on:
  push:
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
  update-major-tag:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Update major version tag
        run: |
          TAG=${GITHUB_REF#refs/tags/}
          MAJOR=$(echo $TAG | cut -d. -f1)  # Extract v0 from v0.1.5
          
          git config user.name github-actions
          git config user.email github-actions@github.com
          git tag -f $MAJOR
          git push origin $MAJOR --force

Alternative solution

Additional context
Suggested by Claude.ai

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions