{"id":22120977,"url":"https://github.com/actions-ecosystem/action-get-latest-tag","last_synced_at":"2025-06-13T02:05:45.047Z","repository":{"id":41121870,"uuid":"261318926","full_name":"actions-ecosystem/action-get-latest-tag","owner":"actions-ecosystem","description":"✨ GitHub Action to get a latest Git tag","archived":false,"fork":false,"pushed_at":"2024-04-17T17:01:06.000Z","size":189,"stargazers_count":51,"open_issues_count":11,"forks_count":47,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-05T01:17:55.992Z","etag":null,"topics":["actions","git","github","tag"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/actions-ecosystem-action-get-latest-tag","language":"Shell","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/actions-ecosystem.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-04T23:35:37.000Z","updated_at":"2025-02-01T18:57:00.000Z","dependencies_parsed_at":"2024-06-18T13:49:01.144Z","dependency_job_id":"7b80e34b-aec0-42de-8284-7247b56c532f","html_url":"https://github.com/actions-ecosystem/action-get-latest-tag","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":"0.11764705882352944","last_synced_commit":"b7c32daec3395a9616f88548363a42652b22d435"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/actions-ecosystem/action-get-latest-tag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-get-latest-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-get-latest-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-get-latest-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-get-latest-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/actions-ecosystem","download_url":"https://codeload.github.com/actions-ecosystem/action-get-latest-tag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-get-latest-tag/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259565566,"owners_count":22877347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actions","git","github","tag"],"created_at":"2024-12-01T14:31:57.229Z","updated_at":"2025-06-13T02:05:45.014Z","avatar_url":"https://github.com/actions-ecosystem.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Action Get Latest Tag\n\n[![actions-workflow-lint][actions-workflow-lint-badge]][actions-workflow-lint]\n[![release][release-badge]][release]\n[![license][license-badge]][license]\n\nThis is a GitHub Action to get a latest Git tag.\n\nIt would be more useful to use this with other GitHub Actions' outputs.\n\n## Inputs\n\n|          NAME          |                                                  DESCRIPTION                                                  |   TYPE   | REQUIRED | DEFAULT  |\n|------------------------|---------------------------------------------------------------------------------------------------------------|----------|----------|----------|\n| `semver_only`          | Whether gets only a tag in the shape of semver. `v` prefix is accepted for tag names.                         | `bool`   | `false`  | `false`  |\n| `initial_version`      | The initial version. Works only when `inputs.with_initial_version` == `true`.                                 | `string` | `false`  | `v0.0.0` |\n| `with_initial_version` | Whether returns `inputs.initial_version` as `outputs.tag` if no tag exists. `true` and `false` are available. | `bool`   | `false`  | `true`   |\n\nIf `inputs.semver_only` is `true`, the latest tag among tags with semver will be set for `outputs.tag`.\n\nThis input is useful for versioning that binds a major version is the latest of that major version (e.g., `v1` == `v1.*`), like GitHub Actions.\nIn such a case, the actual latest tag is a major version, but the version isn't as we expected when we want to work with semver.\n\nLet's say you did the following versioning.\n\n```console\n$ git tag v1.0.0 \u0026\u0026 git push origin v1.0.0\n$ # some commits...\n$ git tag v1.1.0 \u0026\u0026 git push origin v1.1.0\n$ git tag v1 \u0026\u0026 git push origin v1 # bind v1 to v1.1.0.\n```\n\nIn such a case, `outputs.tag` varies like this:\n\n- `inputs.semver_only`=`false` -\u003e `outputs.tag`=`v1`\n- `inputs.semver_only`=`true` -\u003e `outputs.tag`=`v1.1.0`\n\n## Outputs\n\n| NAME  |                                            DESCRIPTION                                             |   TYPE   |\n|-------|----------------------------------------------------------------------------------------------------|----------|\n| `tag` | The latest tag. If no tag exists and `inputs.with_initial_version` == `false`, this value is `''`. | `string` |\n\n## Example\n\n```yaml\nname: Push a new tag with Pull Request\n\non:\n  pull_request:\n    types: [closed]\n\njobs:\n  release:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - uses: actions-ecosystem/action-release-label@v1\n        id: release-label\n        if: ${{ github.event.pull_request.merged == true }}\n\n      - uses: actions-ecosystem/action-get-latest-tag@v1\n        id: get-latest-tag\n        if: ${{ steps.release-label.outputs.level != null }}\n\n      - uses: actions-ecosystem/action-bump-semver@v1\n        id: bump-semver\n        if: ${{ steps.release-label.outputs.level != null }}\n        with:\n          current_version: ${{ steps.get-latest-tag.outputs.tag }}\n          level: ${{ steps.release-label.outputs.level }}\n\n      - uses: actions-ecosystem/action-push-tag@v1\n        if: ${{ steps.release-label.outputs.level != null }}\n        with:\n          tag: ${{ steps.bump-semver.outputs.new_version }}\n          message: '${{ steps.bump-semver.outputs.new_version }}: PR #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}'\n```\n\nFor a further practical example, see [.github/workflows/release.yml](.github/workflows/release.yml).\n\n## License\n\nCopyright 2020 The Actions Ecosystem Authors.\n\nAction Get Latest Tag is released under the [Apache License 2.0](./LICENSE).\n\n\u003c!-- badge links --\u003e\n\n[actions-workflow-lint]: https://github.com/actions-ecosystem/action-get-latest-tag/actions?query=workflow%3ALint\n[actions-workflow-lint-badge]: https://img.shields.io/github/workflow/status/actions-ecosystem/action-get-latest-tag/Lint?label=Lint\u0026style=for-the-badge\u0026logo=github\n\n[release]: https://github.com/actions-ecosystem/action-get-latest-tag/releases\n[release-badge]: https://img.shields.io/github/v/release/actions-ecosystem/action-get-latest-tag?style=for-the-badge\u0026logo=github\n\n[license]: LICENSE\n[license-badge]: https://img.shields.io/github/license/actions-ecosystem/action-add-labels?style=for-the-badge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions-ecosystem%2Faction-get-latest-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factions-ecosystem%2Faction-get-latest-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions-ecosystem%2Faction-get-latest-tag/lists"}