Git release action
evin/git-release@v1 turns prepared repository changes into one local commit
and can attach one annotated tag. With push configured it also publishes the
branch and tag. It does not calculate a version, edit files, create a hosted
release or review request, or upload artifacts.
Configuration
Unknown fields are rejected.
with field | Type | Default | Implemented contract |
|---|---|---|---|
stage | all or existing | all | all stages with git add -A; existing requires and uses the current index without staging other worktree changes. |
message | string | repository policy release message | Optional non-empty pipeline template used as the commit message. |
tag | string | none | Optional non-empty pipeline template for a tag name. |
enabled | boolean or template | true | When false (or a template resolving to false, such as ${release:bump.changed}), succeed without staging, committing, tagging, or pushing and publish committed: false. |
push | object | none | Optional publishing after a successful commit and tag; see Publishing refs. |
Both optional strings receive template-syntax validation. Runtime templates can read values, environment variables, and outputs from prerequisite tasks.
tasks:
bump:
stage: Release
steps:
- uses: evin/version-bumper@v1
with:
files: [Cargo.toml]
release:
stage: Release
needs: [bump]
steps:
- uses: evin/git-release@v1
with:
stage: all
message: "chore(release): ${bump.version}"
tag: "${bump.tag}"
If message is absent, the action uses
releases.commit_message from the resolved repository policy. It fails when neither
source supplies a message.
Choosing a staging boundary
| Mode | What enters the commit | Precondition | Main risk |
|---|---|---|---|
existing | Only changes already in the Git index | At least one staged change must exist | A required release file can be omitted if it was not staged |
all | Every tracked modification/deletion and every untracked file visible to git add -A | The worktree or index must contain a change | Unrelated worktree files can enter the release commit |
Use existing when an earlier command deliberately assembled a reviewable
index:
git add Cargo.toml Cargo.lock CHANGELOG.md
evin run release
Use all only when the task owns the complete worktree state. The default is
all, so choose existing explicitly when isolation is required.
Commit and tag policy
Before mutation, the action verifies that user.name and user.email are
available from Git configuration. Commit creation passes
authorship.policies.require_signatures to the Git provider; when enabled, Git
is invoked with -S.
If tag is configured, the action resolves it, checks it with
git check-ref-format, and rejects an existing tag before it creates the
commit. After a successful commit it runs the equivalent of:
git tag -a <tag> -m <commit-message>
The tag is annotated but is not created with Git's signed-tag flag. Without
push, the action does not consult a remote or test whether the branch can be
pushed.
Publishing refs
push is opt-in. Without it the action stays local.
push field | Type | Default | Contract |
|---|---|---|---|
remote | string | origin | Remote that receives the refs. |
branch | string | current branch | Branch to push to the remote under the same name. |
force | boolean | false | Use git push --force for the branch and tag, for bot-maintained branches that are rebuilt each run. |
prune_stale_tags | boolean | false | After pushing, delete remote tags that match the repository policy tag format, are not the new tag, and whose commit is not reachable from <remote>/<base>. Requires tag and base. Tags whose commit is missing from the local repository are left alone; the local tag ref itself is not needed. |
base | string | none | Branch whose remote-tracking ref (refs/remotes/<remote>/<base>, fetch it first) defines which tags are released. Valid only with prune_stale_tags. |
The push runs after the commit and tag, so a rejected push leaves the local commit and tag intact and reports that the push can be retried. Dry runs report the push (and tag-pruning) plan without contacting the remote.
Failure and recovery boundaries
Check configuration and staged changes. The action stops before changing history if the message is unavailable or the selected staging mode produces no staged change.
Check identity and tag availability. It verifies the Git identity, validates the optional tag name, and rejects an existing tag.
Create the commit. The commit can be signed according to repository policy.
Create the annotated tag. When configured, the action uses the commit message for the tag.
The staging phase itself is a mutation in normal execution. A later identity or tag-preflight error can therefore leave files staged even though no commit was created.
Commit and tag creation are separate Git operations. If the commit succeeds but
tagging fails, the commit remains at HEAD. The action reports the commit ID,
intended tag, and Git error in a recovery diagnostic; it does not reset or amend
history automatically.
Dry runs
The Git provider virtualizes git add, commit, and tag creation. A dry run still:
resolves the message and optional tag templates;
checks for staged or worktree changes according to
stage;verifies Git identity;
validates the tag name and checks the real repository for an existing tag;
honors virtual file changes produced by earlier dry-run steps when
stage: allis used.
No real commit or tag is created. The action itself does not mark this plan
unverified. If a tag is configured, the virtual tag operation succeeds and the
action publishes the resolved tag output.
Outputs
| Output | Availability | Meaning |
|---|---|---|
tag | A configured tag reaches successful normal or virtual tag creation | Resolved local tag name |
committed | Always, unless the step fails | true after a release commit, false when enabled resolved to false |
There is no commit-SHA output and no output when tag is omitted. A dependent
task that needs the commit ID can run git rev-parse HEAD after this task.
Use evin/version-bumper@v1 when one action should discover the next semantic version, update files, and optionally perform the commit and tag. Use this action when those preparations are deliberately separate.
action.evin/git-release@v1 Create a policy-aware local release commit.
Configure release behavior through with:.
action.evin/[email protected] Skip the whole release when false.
Boolean or a template resolving to true or false; defaults to true. When false nothing is staged, committed, tagged, or pushed and committed is false.
action.evin/[email protected] Push the branch and tag after committing.
Opt-in. A rejected push keeps the local commit and tag so it can be retried.
action.evin/[email protected] Overwrite the remote branch and tag.
Uses git push --force, for bot-maintained branches rebuilt on every run.
action.evin/[email protected]_stale_tags Delete unreleased remote tags that match the tag format.
Requires tag and push.base. Tags whose commit is not reachable from <remote>/<base> are deleted; tags whose commit is missing locally are left alone.
action.evin/[email protected] Branch whose remote ref defines which tags are released.
Valid only with prune_stale_tags. Fetch the remote first so refs/remotes/<remote>/<base> exists.