{"id":22003449,"url":"https://github.com/autotag-dev/autotag","last_synced_at":"2026-01-23T18:03:15.799Z","repository":{"id":1358975,"uuid":"42321058","full_name":"autotag-dev/autotag","owner":"autotag-dev","description":"Git repository version tagging tool","archived":false,"fork":false,"pushed_at":"2026-01-12T16:28:44.000Z","size":316,"stargazers_count":202,"open_issues_count":7,"forks_count":45,"subscribers_count":41,"default_branch":"main","last_synced_at":"2026-01-12T21:58:34.838Z","etag":null,"topics":["autotag","build-tools","ci-cd","go","platfrastructure","sig-golang","sig-tools"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/autotag-dev/autotag","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autotag-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-09-11T16:53:43.000Z","updated_at":"2025-12-03T15:28:51.000Z","dependencies_parsed_at":"2022-08-06T10:16:14.524Z","dependency_job_id":"ff722755-9560-40fd-b7a5-ec19af2c08c3","html_url":"https://github.com/autotag-dev/autotag","commit_stats":{"total_commits":107,"total_committers":20,"mean_commits":5.35,"dds":0.7009345794392523,"last_synced_commit":"209bb8509a51f411573563567b912e77eeac1feb"},"previous_names":["autotag-dev/autotag","pantheon-systems/autotag"],"tags_count":56,"template":false,"template_full_name":null,"purl":"pkg:github/autotag-dev/autotag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autotag-dev%2Fautotag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autotag-dev%2Fautotag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autotag-dev%2Fautotag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autotag-dev%2Fautotag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autotag-dev","download_url":"https://codeload.github.com/autotag-dev/autotag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autotag-dev%2Fautotag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28697425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autotag","build-tools","ci-cd","go","platfrastructure","sig-golang","sig-tools"],"created_at":"2024-11-30T00:07:51.616Z","updated_at":"2026-01-23T18:03:15.794Z","avatar_url":"https://github.com/autotag-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"AutoTag\n=======\n\n[![CI](https://github.com/autotag-dev/autotag/actions/workflows/CI.yml/badge.svg)](https://github.com/autotag-dev/autotag/actions/workflows/CI.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/autotag-dev/autotag)](https://goreportcard.com/report/github.com/autotag-dev/autotag)\n\nAutomatically increment version tags to a git repo based on commit messages.\n\nDependencies\n------------\n\n- [Git 2.x](https://git-scm.com/downloads) available in PATH\n\nVersion v1.0.0+ depends on the Git CLI, install Git with your distribution's package management\nsystem.\n\nVersions prior to v1.0.0 use cgo libgit or native golang Git, the binary will work standalone.\n\nInstalling\n----------\n\n### Pre-built binaries\n\n| OS    | Arch  | binary              |\n|-------|-------|---------------------|\n| macOS | amd64 | [autotag][releases] |\n| Linux | amd64 | [autotag][releases] |\n\n### Docker images\n\n\u003e multi-arch and -arm64 images are available beginning with v1.3.34\n\n| Arch       | Images                                                                               |\n|------------|--------------------------------------------------------------------------------------|\n| multi-arch | `ghcr.io/autotag-dev/autotag:latest`, `vX.Y.Z`, `vX.Y`, `vX`                         |\n| amd64      | `ghcr.io/autotag-dev/autotag:latest-amd64`, `vX.Y.Z-amd64`, `vX.Y-amd64`, `vX-amd64` |\n| arm64      | `ghcr.io/autotag-dev/autotag:latest-arm64`, `vX.Y.Z-arm64`, `vX.Y-arm64`, `vX-arm64` |\n\n[releases]: https://github.com/autotag-dev/autotag/releases/latest\n\n### One-liner\n\nAn install script generated by [godownloader](https://github.com/goreleaser/godownloader) is\navailable for all supported platforms. This is often a convenient option for CI pipelines.\n\nExamples:\n\nDownload and install latest version of `autotag` at `./bin/autotag`:\n\n    curl -sL https://git.io/autotag-install | sh --\n\nInstall to a different location using `-b` flag:\n\n    curl -sL https://git.io/autotag-install | sh -s -- -b /usr/bin\n\nInstall a specific version of `autotag`:\n\n    curl -sL https://git.io/autotag-install | sh -- v1.2.1\n\n\u003e Only versions v1.2.0+ are supported by the install script.\n\nUsage\n-----\n\nThe `autotag` utility will use the current state of the git repository to determine what the next\ntag should be and then creates the tag by executing `git tag`. The `-n` flag will print the next tag but not apply it.\n\n`autotag` scans the `main` branch for commits by default. If no `main` branch is found, it will\nfall back to the `master` branch.  Use `-b/--branch` to scan a different branch. The utility first\nlooks to find the most-recent reachable tag that matches a supported versioning scheme. If no tags\ncan be found the utility bails-out, so you do need to create a `v0.0.0` tag before using `autotag`.\n\nOnce the last reachable tag has been found, the `autotag` utility inspects each commit between the\ntag and `HEAD` of the branch to determine how to increment the version.\n\nCommit messages are parsed for keywords via schemes. Schemes influence the tag selection according\nto a set of rules.\n\nSchemes are specified using the `-s/--scheme` flag:\n\n### Scheme: Autotag (default)\n\nThe autotag scheme implements SemVer style versioning `vMajor.Minor.Patch` (e.g., `v1.2.3`).\n\nBefore using autotag for the first time create an initial SemVer tag,\neg: `git tag v0.0.0 -m'initial tag'`\n\nThe next version tag is calculated based on the contents of commit message according to these\nrules:\n\n- Bump the **major** version by including `[major]` or `#major` in a commit message, eg:\n\n```\n[major] breaking change\n```\n\n- Bump the **minor** version by including `[minor]` or `#minor` in a commit message, eg:\n\n```\n[minor] new feature added\n```\n\n- Bump the **patch** version by including `[patch]` or `#patch` in a commit message, eg:\n\n```\n[patch] bug fixed\n```\n\nIf no keywords are specified a **Patch** bump is applied.\n\n### Scheme: Conventional Commits\n\nSpecify the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#examples) v1.0.0\nscheme by passing `--scheme=conventional` to `autotag`.\n\nConventional Commits implements SemVer style versioning `vMajor.Minor.Patch` similar to the\nautotag scheme, but with a different commit message format.\n\nExamples of Conventional Commits:\n\n- A commit message footer containing `BREAKING CHANGE:` will bump the **major** version:\n\n```\nfeat: allow provided config object to extend other configs\n\nBREAKING CHANGE: `extends` key in config file is now used for extending other config files\n```\n\n- A commit message header containing a _type_ of `feat` will bump the **minor** version:\n\n```\nfeat(lang): add polish language\n```\n\n- A commit message header containg a `!` after the _type_ is considered a breaking change and will\n  bump the **major** version:\n\n```\nrefactor!: drop support for Node 6\n```\n\nIf no keywords are specified a **Patch** bump is applied.\n\n### Strict Match Option\n\nThe `--strict-match` option enforces that commit messages must strictly adhere to the specified commit message scheme.\nWhen this option is enabled, the parser will return an error if a commit message does not conform to\nthe expected format, preventing the commit from being processed. This ensures that only commits with valid messages\nare considered for version bumps.\n\n#### Effect on Default Behavior for All Schemes\n\nWhen the `--strict-match` option is enabled, the behavior of the commit message parsing changes as follows:\n\n- **Autotag Scheme**:\n  - Without `--strict-match`: Commit messages that do not contain `[major]`, `[minor]`, or `[patch]` will result in a\n  patch version bump by default.\n  - With `--strict-match`: Commit messages that do not contain `[major]`, `[minor]`, or `[patch]` will result in an\n  error, and the commit will not be processed.\n\n- **Conventional Commits Scheme**:\n  - Without `--strict-match`: Commit messages that do not follow the conventional commit format will result in a\n  patch version bump by default.\n  - With `--strict-match`: Commit messages that do not follow the conventional commit format will result in an\n  error, and the commit will not be processed.\n\n#### Usage\n\nTo use the strict match option, add the `--strict-match` flag when running the autotag tool:\n\n```sh\nautotag --strict-match\n```\n\n### Pre-Release Tags\n\n`autotag` supports appending additional text to the calculated next version string:\n\n- Use `-p/--pre-release-name=` to append a pre-release **name** to the version. Pre-release names are subject to the rules outlined in the [SemVer](https://semver.org/#spec-item-9)\n  spec.\n\n- Use `-T/--pre-release-timestmap=` to append **timestamp** to the version. Allowed timetstamp\n  formats are `datetime` (YYYYMMDDHHMMSS) or `epoch` (UNIX epoch timestamp in seconds).\n\n### Build metadata\n\nOptional SemVer build metadata can be appended to the version string after a `+` character using the `-m/--build-metadata` flag. eg: `v1.2.3+foo`\n\nBuild metadata is subject to the rules outlined in the [SemVer](https://semver.org/#spec-item-10)\nspec.\n\nA common use might be the current git reference: `git rev-parse --short HEAD`.\n\nMultiple metadata items should be seperated by a `.`, eg: `foo.bar`\n\nExamples\n--------\n\n```console\n$ autotag\n3.2.1\n```\n\n```console\n$ autotag -p pre\n3.2.1-pre\n\n$ autotag -T epoch\n3.2.1-1499320004\n\n$ autotag -T datetime\n3.2.1-20170706054703\n\n$ autotag -p pre -T epoch\n3.2.1-pre.1499319951\n\n$ autotag -p rc -T datetime\n3.2.1-rc.20170706054528\n\n$ autotag -m g$(git rev-parse --short HEAD)\n3.2.1+ge92b825\n\n$ autotag -p dev -m g$(git rev-parse --short HEAD)\n3.2.1-dev+ge92b825\n\n$ autotag -m $(date +%Y%M%d)\n3.2.1-dev+20200518\n\n$ autotag  -m g$(git rev-parse --short HEAD).$(date +%s)\n3.2.1+g11492a8.1589860151\n```\n\nFor additional help information use the `-h/--help` flag:\n\n```console\nautotag -h\n```\n\n### Build Number\n\nSome modern build systems (like: iOS, Android,.. ) support two parts of version: \u003cversion_name\u003e+\u003cbuild_number\u003e. eg: v1.0.1+123\n\nOptional SemVer build metadata in build number format can be appended to the version string after a `+` character using the `--build-number` flag.  \n\nExamples\n--------\n\nCurrent git repo has initial version `v0.0.1` \n\n```console\n$ autotag --build-number\nv0.0.1+1\n```\n\nCurrent git repo has initial version `v1.0.1+123`\n\n```console\n$ autotag --build-number\nv1.0.2+124\n```\n\nYou can use build number in develop branch too, for ex: current version is `v1.0.1-dev+123`\n\n```console\n$ autotag --build-number -b develop -p dev\nv1.0.2-dev+124\n```\n\n### Goreleaser\n\n`autotag` works well with [goreleaser](https://goreleaser.com/) for automating the process of\ncreating new versions and releases from CI.\n\nAn example of a [Circle-CI](https://circleci.com/) job utilizing both `autotag` and `goreleaser`:\n\n```yaml\njobs:\n  release:\n    steps:\n      - run:\n          name: install autotag binary\n          command: |\n            curl -sL https://git.io/autotag-install | sudo sh -s -- -b /usr/bin\n      - run:\n          name: increment version\n          command: |\n           autotag\n      - run:\n          name: build and push releases\n          command: |\n            curl -sL https://git.io/goreleaser | bash -s -- --parallelism=2 --rm-dist\n\nworkflows:\n  version: 2\n  build-test-release:\n    jobs:\n      - release\n          requires:\n            - build\n          filters:\n            branches:\n              only:\n                - master\n```\n\nTroubleshooting\n---------------\n\n### error getting head commit: object does not exist [id: refs/heads/master, rel_path: ]\n\n```\nerror getting head commit: object does not exist [id: refs/heads/master, rel_path: ]\n```\n\nYou may run into this error on certain CI platforms such as Github Actions or Azure DevOps\nPipelines. These platforms tend to make shallow clones of the git repo leaving out important data\nthat `autotag` expects to find. This can be solved by adding the following commands prior to\nrunning `autotag`:\n\n```sh\n# fetch all tags and history:\ngit fetch --tags --unshallow --prune\n\nif [ $(git rev-parse --abbrev-ref HEAD) != \"master\" ]; then\n  # ensure a local 'master' branch exists at 'refs/heads/master'\n  git branch --track master origin/master\nfi\n```\n\nBuild from Source\n-----------------\n\nAssuming you have Go 1.5+ installed you can checkout and run make deps build to compile the binary\nat `./autotag/autotag`.\n\n```console\ngit clone https://github.com/autotag-dev/autotag.git\n\ncd autotag\n\nmake test\nmake build\n```\n\nRelease information\n-------------------\n\nAutotag itself uses `autotag` to increment releases. The default [autotag](#scheme-autotag-default)\nscheme is used for version selection.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautotag-dev%2Fautotag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautotag-dev%2Fautotag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautotag-dev%2Fautotag/lists"}