{"id":50982877,"url":"https://github.com/carry0987/version-extractor","last_synced_at":"2026-06-19T16:04:57.968Z","repository":{"id":344179740,"uuid":"1180794862","full_name":"carry0987/version-extractor","owner":"carry0987","description":"A GitHub Action to extract and parse semantic versions from tags, refs, or manual input.","archived":false,"fork":false,"pushed_at":"2026-03-20T14:31:47.000Z","size":281,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-21T06:41:11.206Z","etag":null,"topics":["actions","semver","tsdown","typescript"],"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/carry0987.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-13T12:21:51.000Z","updated_at":"2026-03-20T14:31:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/carry0987/version-extractor","commit_stats":null,"previous_names":["carry0987/version-extractor"],"tags_count":7,"template":false,"template_full_name":"carry0987/ts-action-starter","purl":"pkg:github/carry0987/version-extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carry0987%2Fversion-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carry0987%2Fversion-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carry0987%2Fversion-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carry0987%2Fversion-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carry0987","download_url":"https://codeload.github.com/carry0987/version-extractor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carry0987%2Fversion-extractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34538480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["actions","semver","tsdown","typescript"],"created_at":"2026-06-19T16:04:54.724Z","updated_at":"2026-06-19T16:04:57.963Z","avatar_url":"https://github.com/carry0987.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Version Extractor\n\nA GitHub Action that extracts and parses semantic versions from tags, refs, or manual input. Provides the full version string and individual semver components as action outputs.\n\n## Usage\n\n```yaml\n- uses: carry0987/version-extractor@v1\n  id: version\n  with:\n    tag: ${{ github.event.release.tag_name }}\n\n- run: echo \"Deploying version ${{ steps.version.outputs.version }}\"\n  # outputs.version → v1.3.0\n  # outputs.version-number → 1.3.0\n```\n\n## Inputs\n\n| Input | Required | Default | Description |\n|-------|----------|---------|-------------|\n| `tag` | No | `''` | Tag to extract version from (e.g. `v1.3.0`). Takes priority over `fallback-ref`. |\n| `fallback-ref` | No | `${{ github.ref_name }}` | Fallback ref name when `tag` is empty |\n| `prefix` | No | `v` | Version prefix to strip |\n| `strict` | No | `true` | Whether to strictly validate semver format |\n| `extract-pattern` | No | `''` | Regex to extract version from raw input (first capture group is used if present) |\n| `fail-on-error` | No | `true` | Whether to fail the action when version extraction fails |\n\n## Outputs\n\n| Output | Description | Example |\n|--------|-------------|---------|\n| `found` | Whether a valid version was found | `true` / `false` |\n| `source` | The raw input string before any processing | `v1.3.0` |\n| `version` | Full version string with prefix | `v1.3.0` |\n| `version-number` | Version string without prefix | `1.3.0` |\n| `major` | Major version number | `1` |\n| `minor` | Minor version number | `3` |\n| `patch` | Patch version number | `0` |\n| `prerelease` | Prerelease identifier (if any) | `beta.1` |\n| `is-prerelease` | Whether the version is a prerelease | `true` / `false` |\n\n## Examples\n\n### Extract version from a release tag\n\n```yaml\non:\n  release:\n    types: [published]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: carry0987/version-extractor@v1\n        id: version\n        with:\n          tag: ${{ github.event.release.tag_name }}\n\n      - run: |\n          echo \"Version: ${{ steps.version.outputs.version }}\"\n          echo \"Version Number: ${{ steps.version.outputs.version-number }}\"\n          echo \"Major: ${{ steps.version.outputs.major }}\"\n```\n\n### Extract version from a pushed tag\n\n```yaml\non:\n  push:\n    tags: ['v*']\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: carry0987/version-extractor@v1\n        id: version\n\n      - run: echo \"Building ${{ steps.version.outputs.version }}\"\n```\n\n### Custom prefix\n\n```yaml\n- uses: carry0987/version-extractor@v1\n  id: version\n  with:\n    tag: 'release-2.5.1'\n    prefix: 'release-'\n# outputs.version → release-2.5.1\n# outputs.version-number → 2.5.1\n```\n\n### Prerelease detection\n\n```yaml\n- uses: carry0987/version-extractor@v1\n  id: version\n  with:\n    tag: 'v3.0.0-beta.1'\n\n- if: steps.version.outputs.is-prerelease == 'true'\n  run: echo \"This is a prerelease!\"\n```\n\n### Extract version from text with regex\n\nUse `extract-pattern` to pull a version out of arbitrary text (e.g. commit messages):\n\n```yaml\n- uses: carry0987/version-extractor@v1\n  id: version\n  with:\n    tag: 'chore: release v1.2.0'\n    extract-pattern: 'v?(\\d+\\.\\d+\\.\\d+)'\n# outputs.version → v1.2.0\n# outputs.version-number → 1.2.0\n```\n\n### Soft failure mode\n\nSet `fail-on-error` to `false` to emit a warning instead of failing the action when no version is found:\n\n```yaml\n- uses: carry0987/version-extractor@v1\n  id: version\n  with:\n    tag: 'not-a-version'\n    fail-on-error: false\n\n- if: steps.version.outputs.found == 'true'\n  run: echo \"Version ${{ steps.version.outputs.version }}\"\n```\n\n### Strict mode (default)\n\nStrict mode only accepts valid semver strings:\n\n```yaml\n- uses: carry0987/version-extractor@v1\n  with:\n    tag: '1.3'\n# ❌ Fails — \"1.3\" is not valid semver\n```\n\n### Non-strict mode\n\nNon-strict mode uses `semver.coerce` as a fallback, accepting partial versions:\n\n```yaml\n- uses: carry0987/version-extractor@v1\n  with:\n    tag: '1.3'\n    strict: false\n# outputs.version → 1.3.0\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarry0987%2Fversion-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarry0987%2Fversion-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarry0987%2Fversion-extractor/lists"}