Skip to content
Configuration index

Configuration index

tagpr reads .tagpr in Git config format. Every setting also has a corresponding TAGPR_* environment variable, and environment variables take precedence over the configuration file.

[tagpr]
    releaseBranch = main
    versionFile = version.go
    changelog = true
    release = draft

The complete field-by-field descriptions and defaults currently live in the README configuration reference . This page groups the settings by purpose so you can find the relevant options quickly.

Path resolution

Relative paths are resolved from tagpr’s working directory, not from the directory that contains .tagpr. The GitHub Action changes to GITHUB_WORKSPACE before running tagpr, so configuration paths are relative to the repository root.

This applies to versionFile, changelogFile, releaseYAMLPath, and template. Configured commands also run from the repository root, and automatic version-file detection scans from there.

Release target

SettingPurpose
tagpr.releaseBranchRelease branch into which the release pull request is merged
tagpr.fixedMajorVersionTarget a maintenance branch at one major release line

Version selection

SettingPurpose
tagpr.versionFileVersion file paths, automatic detection, or tag-only mode
tagpr.vPrefixAdd v to SemVer tags
tagpr.majorLabelsLabels on merged pull requests that imply a major release
tagpr.minorLabelsLabels on merged pull requests that imply a minor release
tagpr.calendarVersioningEnable CalVer and select its format

See Versioning and label rules for the complete SemVer, version-file, and CalVer precedence rules.

Generated files and commands

SettingPurpose
tagpr.changelogEnable or disable changelog updates
tagpr.changelogFileSelect the changelog path
tagpr.releaseYAMLPathSelect the generated release-notes configuration
tagpr.commandRun a command before version files are updated
tagpr.postVersionCommandRun a command after version files are updated

Commands receive TAGPR_CURRENT_VERSION and TAGPR_NEXT_VERSION. See Release preparation commands for execution order, examples, and file-handling details.

Release pull request

SettingPurpose
tagpr.templateUse a Go template file for the pull request
tagpr.templateTextUse an inline Go template
tagpr.commitPrefixCustomize the prefix of tagpr commits

See Release pull request templates for the output format, available variables, and examples.

GitHub Release

SettingPurpose
tagpr.releaseCreate a published release, a draft, or no GitHub Release

See Immutable GitHub Releases when a later workflow must attach assets before publishing.

Monorepos

Use tagpr.tagPrefix to give each independently released project its own tag namespace. The configuration itself can live in the project’s directory:

- uses: Songmu/tagpr@v1
  with:
    config: tools/.tagpr
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Paths in that file remain relative to the repository root. Also scope the version file, changelog, and release-note configuration:

# tools/.tagpr
[tagpr]
    tagPrefix = tools
    versionFile = tools/package.json
    changelogFile = tools/CHANGELOG.md
    releaseYAMLPath = tools/.github/release.yml

This configuration creates tags such as tools/v1.2.3.

Action configuration

The GitHub Action has two inputs:

  • config selects a configuration file other than .tagpr;
  • version selects the tagpr executable version installed by the action.

It exposes tag, pull_request, and base_tag outputs. See Publishing after a release for usage.