daily-version-action

June 30, 2026 ยท View on GitHub

Creates a new tag using the format Y.M.D (using daily-version), but only if HEAD isn't already tagged.

Ideally used on schedule, but you could also change the suggested condition to only make it run on main.

See usage real-world example on Refined GitHub's repo

Usage

It expects git to be configured to push to the same repo.

  • actions/checkout automatically sets required token to push the tag to the repo.
  • If not already set, the tag author will be daily-version-action <actions@users.noreply.github.com>. This can be customized with something like setup-git-token.

See action.yml

  Version:
    steps:
    - uses: actions/checkout@v6
    - name: Create tag if necessary
      uses: fregante/daily-version-action@v3

You can use the DAILY_VERSION_CREATED and DAILY_VERSION environment variables created by this action to test whether a new version has been created:

    - name: Create tag if necessary
      uses: fregante/daily-version-action@v3
    - name: Created?
      if: env.DAILY_VERSION_CREATED
      run: echo "Yes, created $DAILY_VERSION"

If you prefer, you can use its outputs too, which can also work across jobs:

    - name: Create tag if necessary
      id: version
      uses: fregante/daily-version-action@v3
    - name: Created?
      if: steps.version.outputs.created
      run: echo "Created ${{ steps.version.outputs.version }}"

Inputs

  • prefix - Optional. String to prepend to the tag name. For example, v will create tags like v20.12.31.
  • custom-version - Optional. Override the version number instead of generating one with daily-version. Tag creation logic still applies.
  Version:
    steps:
    - uses: actions/checkout@v6
    - name: Create tag if necessary
      uses: fregante/daily-version-action@v3
      with:
        prefix: v
        custom-version: '1.2.3'

Outputs

  • created - If this output exists, this action created a new tag.
  • version - The latest tag, whether it already existed or if it just created one.

Outputs can be used across jobs as well.

Examples

Nightly release

Here's a complete workflow to create a nightly release, when necessary: (original here)

on:
  schedule:
    - cron: '59 23 * * *'
  workflow_call:
    inputs:
      custom-version:
        type: string
        description: Override the version number
        required: false

jobs:
  Tag:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6
    - uses: fregante/daily-version-action@v3
      name: Create tag if necessary
      id: daily-version
      with:
        custom-version: ${{ inputs.custom-version }}
    outputs:
      created: ${{ steps.daily-version.outputs.created }}
      version: ${{ steps.daily-version.outputs.version }}

  Next:
    needs: Tag
    if: needs.Tag.outputs.created
    runs-on: ubuntu-latest
    steps:
      - run: echo It looks like ${{ needs.Tag.outputs.version }} was created!

License

MIT ยฉ Federico Brigante