Skip to content

Add customizable tag format with date/time/SHA tokens#1

Merged
igorgatis merged 7 commits intomainfrom
feature/customizable-tag-format
Nov 12, 2025
Merged

Add customizable tag format with date/time/SHA tokens#1
igorgatis merged 7 commits intomainfrom
feature/customizable-tag-format

Conversation

@igorgatis
Copy link
Owner

Summary

This PR adds a customizable tag-format input parameter that allows users to format release tags using various date, time, and SHA tokens. The default format remains backward compatible.

Key Features

  • Comprehensive token support:

    • Year: {YYYY} (4-digit), {YY} (2-digit)
    • Month: {MM} (padded), {M} (unpadded)
    • Day: {DD} (padded), {D} (unpadded)
    • Hour: {HH} (padded), {H} (unpadded)
    • Minute: {mm} (padded), {m} (unpadded)
    • Second: {ss} (padded), {s} (unpadded)
    • SHA: {sha} (full), {sha:N} (N characters)
  • Semver compatibility: Users can create semver-compatible tags like {YYYY}.{M}.{D} (e.g., 2024.4.26)

  • Backward compatible: Default format remains {YYYY}{MM}{DD}-{HH}{mm}{ss}-{sha:8}

Examples

tag-format: "v{YYYY}.{MM}.{DD}-{sha:7}"
tag-format: "{YYYY}.{M}.{D}"
tag-format: "{YY}{MM}{DD}-{HH}{mm}-{sha:6}"

Documentation

  • Added comprehensive token documentation in README
  • Included example workflows for common use cases
  • Added link to semver checker for validation

🤖 Generated with Claude Code

igorgatis and others added 7 commits November 12, 2025 08:20
Users can now customize the tag format using the new tag-format input
parameter. Supports various tokens including year, month, day, hour,
minute, second (both padded and unpadded), and SHA with configurable
length.

Features:
- Add tag-format input parameter with comprehensive token support
- Support both padded ({MM}) and non-padded ({M}) date/time formats
- Support 2-digit ({YY}) and 4-digit ({YYYY}) year formats
- Support variable-length SHA via {sha:N} syntax
- Include semver-compatible format examples
- Link to semver checker for validation

Default format remains backward compatible: {YYYY}{MM}{DD}-{HH}{mm}{ss}-{sha:8}

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Rename tagFormat to tag and remove unnecessary const declaration.
The variable is directly assigned the final tag value through
successive replacements.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update all usage examples to reference v2 as this release introduces
the new tag-format feature which requires a new version tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Change default tag-format from {sha:8} to {sha:7} to maintain backward
compatibility with v1, which used 7-character SHA by default.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add new output 'long-sha' that provides the full commit SHA, in
addition to the existing 'short-sha' output.

Updates:
- Add long-sha output definition in action.yml
- Set long-sha output with full SHA value
- Update README outputs table
- Update example workflow to demonstrate long-sha usage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Change "Deploying" to "Release tag:" for better clarity in the
example that demonstrates using outputs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit 762bafe.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@igorgatis igorgatis merged commit 5cebaf3 into main Nov 12, 2025
@igorgatis igorgatis deleted the feature/customizable-tag-format branch November 12, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments