{"id":13533780,"url":"https://github.com/ankitvgupta/ref-to-tag-action","last_synced_at":"2026-04-04T18:05:06.036Z","repository":{"id":74282622,"uuid":"271403846","full_name":"ankitvgupta/ref-to-tag-action","owner":"ankitvgupta","description":"Extract a docker-compatible tag name from a github ref","archived":false,"fork":false,"pushed_at":"2023-01-19T17:01:21.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-22T23:46:16.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankitvgupta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-06-10T23:07:52.000Z","updated_at":"2023-03-16T00:17:03.000Z","dependencies_parsed_at":"2023-05-01T03:02:02.045Z","dependency_job_id":null,"html_url":"https://github.com/ankitvgupta/ref-to-tag-action","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankitvgupta%2Fref-to-tag-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankitvgupta%2Fref-to-tag-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankitvgupta%2Fref-to-tag-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankitvgupta%2Fref-to-tag-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankitvgupta","download_url":"https://codeload.github.com/ankitvgupta/ref-to-tag-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246720419,"owners_count":20822898,"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":[],"created_at":"2024-08-01T07:01:23.022Z","updated_at":"2026-04-04T18:05:00.999Z","avatar_url":"https://github.com/ankitvgupta.png","language":"Shell","funding_links":[],"categories":["Community Resources"],"sub_categories":["Deployment"],"readme":"# ref-to-tag Github Action\n\nThis action uses your Github context to extract your branch or tag name for use in other steps. It also formats the name to be compatible for use as the name of a docker container.\n\n- On a pull request, this will use the \"head\" branch of your PR. i.e. the branch that you are merging into the base branch.\n- On pushing a branch, it'll return the name of the branch you're pushing to.\n- On pushing a tag, it'll return the name of the tag.\n- Any slashes in the branch/tag names are converted to dots to make them valid with Docker but unlikely to collide with other branch names.\n\nBranch -\u003e Tag Examples:\n\n\t- PR feature/my-branch -\u003e feature.my-branch\n\t- PR feature/my/weird/branchname -\u003e feature.my.weird.branchname\n\t- push to feature/my-branch -\u003e feature.my-branch\n\t- push to my-branch -\u003e my-branch\n\t- release/push of v1.0.5 tag -\u003e v1.0.5\n\nNote that you should always pass both the `github.ref` and `github.head_ref`, and the script is smart enough to know which to look at depending on which are filled.\n\n## Inputs\n\n### `ref`\n\n**Required** Pass `${{ github.ref }}`.\n\n### `head_ref`\n\n**Required** Pass `${{ github.head_ref }}`.\n\nNote that if this is a push to a branch (and not a PR), the head_ref will be an empty string. That is fine, the action will know to ignore it.\n\n\n## Outputs\n\n### `tag`\n\nThe tag it parsed for you.\n\n## Example usage\n\nSee `.github/workflows/example.yaml` for a working example in this repo.\n\n``` yaml\non: [pull_request, push]\n\njobs:\n  get-ref-example:\n    runs-on: ubuntu-latest\n    name: get-ref-example\n    steps:\n    - name: Get the Ref\n      id: get-ref\n      uses: ankitvgupta/ref-to-tag-action@master\n      with:\n        ref: ${{ github.ref }}\n        head_ref: ${{ github.head_ref }}\n    - name: Get the tag\n      run: echo \"The tag was ${{ steps.get-ref.outputs.tag }}\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankitvgupta%2Fref-to-tag-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankitvgupta%2Fref-to-tag-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankitvgupta%2Fref-to-tag-action/lists"}