{"id":17227359,"url":"https://github.com/muravjev/gha-get-version","last_synced_at":"2026-05-09T01:13:31.320Z","repository":{"id":63102216,"uuid":"561224293","full_name":"muravjev/gha-get-version","owner":"muravjev","description":"A GitHub Action which extracts the version from the last version git tag and number of commits on top of it.","archived":false,"fork":false,"pushed_at":"2022-11-12T22:17:25.000Z","size":200,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T17:52:08.991Z","etag":null,"topics":["action","actions","get","git","githab","github-actions","semver","tag","version"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muravjev.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},"funding":{"custom":["https://paypal.me/muravjev","https://www.buymeacoffee.com/muravjev"]}},"created_at":"2022-11-03T08:20:03.000Z","updated_at":"2022-11-12T15:04:33.000Z","dependencies_parsed_at":"2022-11-12T23:00:45.586Z","dependency_job_id":null,"html_url":"https://github.com/muravjev/gha-get-version","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muravjev/gha-get-version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muravjev%2Fgha-get-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muravjev%2Fgha-get-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muravjev%2Fgha-get-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muravjev%2Fgha-get-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muravjev","download_url":"https://codeload.github.com/muravjev/gha-get-version/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muravjev%2Fgha-get-version/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32803656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["action","actions","get","git","githab","github-actions","semver","tag","version"],"created_at":"2024-10-15T04:19:04.561Z","updated_at":"2026-05-09T01:13:31.305Z","avatar_url":"https://github.com/muravjev.png","language":"TypeScript","funding_links":["https://paypal.me/muravjev","https://www.buymeacoffee.com/muravjev","https://www.paypal.me/muravjev"],"categories":[],"sub_categories":[],"readme":"# Get Version\n\nA GitHub Action which gets version from the current github repository considering:\n\n- optional tag **matching** (default match is `*` - any latest tag).\n- optional version **bumping** (default bump is `none` - no bumping).\n- optional version **formatting** (default format is semver format).\n\n## Usage\n\n```yml\nsteps:\n  - uses: actions/checkout@v3\n    with:\n      fetch-depth: 0 # \u003c-- This is required!\n\n  - id: get-version\n    uses: muravjev/get-version-action\n\n  - run: echo ${{ steps.get-version.outputs.version }}\n```\n\n## Workflow\n\n1. Tag is determined\n\n   - Match the latest tag that satisfy provided pattern (`match` parameter).\n   - If provided pattern is `*` (default) then the latest tag is taken.\n   - If there is no matched tag found then a default value (`default` parameter) used as a tag.\n\n2. Version parameters determined\n\n   - `prefix`, `major`, `minor`, `patch`, `prerelease` and `metadata` parameters are extracted from the tag, considering that the tag has **semver** format with optional prefix.\n   - `hash` parameter is determined as the latest commit hash.\n   - `commits` parameter is calculated as a number of commits between latest commit and matched tag. If there is no matched tag, total number of commits is taken.\n\n3. Bumping (optional)\n\n   Version parameters `major`, `minor`, `patch` are adjusted in accordance with provided bumping scheme (`bump` parameter).\n\n4. Version is formatted\n\n   Version is formatted in accordance with provided pattern (`format` and `trim` parameters) where version parameters placeholders are replaced with actual version parameters.\n\n## Inputs\n\n- **match** - pattern to match the latest tag to extract the version from.\\\n  format: [glob(7)][glob] pattern.\\\n  default: `*`.\n\n- **default** - tag to extract version if no tag exists or matched by `match` pattern.\\\n  values: semver version tag (e.g. `1.2.3`), semver tag with prefix (`package@1.2.3-beta.4+build.567`).\\\n  default: `1.0.0`\n\n- **bump** - type of the bump to perform over version values.\\\n  values: `major`, `minor`, `patch` or `none` \\\n  default: `none` - no bump.\n\n  \u003cdetails\u003e\n  \u003csummary\u003edetails\u003c/summary\u003e\n  \u003cbr\u003e\n\n  **Example:**\\\n  Consider that we have the following version values:\n\n  | major | minor | patch |\n  | :---: | :---: | :---: |\n  |   1   |   2   |   3   |\n\n  Then the following will be true:\n\n  |  bump   | major | minor | patch |\n  | :-----: | :---: | :---: | :---: |\n  | `none`  |   1   |   2   |   3   |\n  | `major` |  `2`  |  `0`  |  `0`  |\n  | `minor` |   1   |  `3`  |  `0`  |\n  | `patch` |   1   |   2   |  `4`  |\n\n  \u003cbr\u003e\n  \u003c/details\u003e\n\n- **format** - format of the output version.\\\n  format: `{prefix}{major}.{minor}.{patch}-{prerelease}+{metadata}#{commits}@{hash}`.\\\n  default: `{major}.{minor}.{patch}-{prerelease}+{metadata}`.\n\n- **trim** - fields which prefixes should be removed if its value is 'empty'.\\\n  values: pipe separated version fields.\\\n  default: `prerelease|metadata|commits`.\n\n  \u003cdetails\u003e\n  \u003csummary\u003edetails\u003c/summary\u003e\n  \u003cbr\u003e\n\n  Available fields to trim and its corresponded values considered as 'empty':\n\n  | field      | 'empty' value |\n  | :--------- | :------------ |\n  | prefix     | `''`          |\n  | prerelease | `''`          |\n  | metadata   | `''`          |\n  | patch      | `''` or `0`   |\n  | commits    | `''` or `0`   |\n\n  **Example:**\\\n  Consider that we have provided the following format\\\n  `{major}.{minor}.{patch}+build.{commits}`,\\\n  then the following will be true:\n\n  | major | minor | patch | commits | trim             | result        |\n  | :---: | :---: | :---: | :-----: | :--------------- | :------------ |\n  |   1   |   2   |   3   |    4    | doesn't matter   | 1.2.3+build.4 |\n  |   1   |   3   |   0   |    0    | none             | 1.2.0+build.0 |\n  |   1   |   2   |   0   |    0    | `patch\\|commits` | 1.2           |\n  |   1   |   2   |   0   |    0    | `patch`          | 1.2+build.0   |\n  |   1   |   2   |   0   |    0    | `commits`        | 1.2.0         |\n\n  \u003c/details\u003e\n\n## Outputs\n\n- **version** - Formatted version.\n\n## Contributing\n\nWant to contribute? Awesome! The most basic way to show your support is to star ⭐ the project, or to raise issues. If you want to open a pull request, please read the [Contributing Guidelines][guidelines].\n\n## Donation\n\n\u003c!-- prettier-ignore-start --\u003e\n\n| If you found this project helpful, consider |\n| :---: |\n[**buying me a coffee**][buymeacoffee], [**donate by paypal**][paypal] or just [**leave a star**](../..)⭐\nThanks for your support, it is much appreciated!\n\n\u003c!-- prettier-ignore-end --\u003e\n\n## License\n\n[MIT](LICENSE) © [Sergey Muravjev][muravjev]\n\n[glob]: https://man7.org/linux/man-pages/man7/glob.7.html\n[guidelines]: https://github.com/muravjev/.github/blob/main/CONTRIBUTING.md\n[buymeacoffee]: https://www.buymeacoffee.com/muravjev\n[paypal]: https://www.paypal.me/muravjev\n[muravjev]: https://github.com/muravjev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuravjev%2Fgha-get-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuravjev%2Fgha-get-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuravjev%2Fgha-get-version/lists"}