Skip to content

Support custom tag message from CLI or file (for artifact metadata) #39

Description

@a-magdy

Summary

  • Allow customizing the annotated tag message used by git-artifact from either a command-line string or a file/STDIN.
  • This lets users embed build/CI metadata so artifacts can be discovered and audited later.

Current behavior

  • Tag message content is not directly configurable from the CLI (users cannot supply an arbitrary message body).

Expected behavior / Interface

  • --message, -m "": set the tag message directly from the command line (supports multi-line via shell quoting).
  • --message-file, -F : read the tag message from a file. Use - to read from STDIN.
  • Precedence and validation:
    • Disallow using --message and --message-file together (match git's behavior: error out if both are provided).
    • If neither flag is provided, keep the current default message behavior.
  • Optional CI env support:
    • Respect env vars GIT_ARTIFACT_MESSAGE or GIT_ARTIFACT_MESSAGE_FILE when flags are not provided (useful in CI).

Notes and edge cases

  • Multi-line messages should be preserved as-is (like git tag -a -m/-F).
  • Very large messages: consider a reasonable size limit to avoid accidental bloat.
  • Non-UTF-8 input: either reject with a clear error or document how it will be handled.
  • Empty message (0 bytes): fall back to the default message or require an explicit --allow-empty-message flag.

Examples

  • git-artifact create -m "Build $GITHUB_RUN_ID | SHA: $GITHUB_SHA"
  • git-artifact create -F artifact-message.txt
  • printf "build: %s\nurl: %s\n" "$CI_PIPELINE_ID" "$CI_JOB_URL" | git-artifact create -F -

Rationale

  • Users often need to annotate artifacts with provenance metadata (pipeline ID, commit, URL, versions). First-class support makes this safer and more ergonomic.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions