{"id":13702662,"url":"https://github.com/proudust/gh-describe","last_synced_at":"2025-04-10T06:50:36.328Z","repository":{"id":41501613,"uuid":"385941076","full_name":"proudust/gh-describe","owner":"proudust","description":"Emulate `git describe --tags` for shallow clone repositories.","archived":false,"fork":false,"pushed_at":"2024-10-15T23:08:17.000Z","size":1572,"stargazers_count":20,"open_issues_count":7,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T11:11:23.407Z","etag":null,"topics":["deno","gh-extension","github-actions"],"latest_commit_sha":null,"homepage":"https://deno.land/x/gh_describe","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/proudust.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":"2021-07-14T12:59:07.000Z","updated_at":"2025-03-10T23:06:47.000Z","dependencies_parsed_at":"2024-10-18T01:50:46.914Z","dependency_job_id":null,"html_url":"https://github.com/proudust/gh-describe","commit_stats":{"total_commits":174,"total_committers":2,"mean_commits":87.0,"dds":"0.14942528735632188","last_synced_commit":"0a778638a00055d55cb942c9605915ba8eb02755"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proudust%2Fgh-describe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proudust%2Fgh-describe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proudust%2Fgh-describe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proudust%2Fgh-describe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/proudust","download_url":"https://codeload.github.com/proudust/gh-describe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173852,"owners_count":21059595,"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":["deno","gh-extension","github-actions"],"created_at":"2024-08-02T21:00:40.429Z","updated_at":"2025-04-10T06:50:36.301Z","avatar_url":"https://github.com/proudust.png","language":"TypeScript","funding_links":[],"categories":["Tool","github-actions"],"sub_categories":[],"readme":"# gh describe\n\nEmulate `git describe --tags` for shallow clone repositories.\n\nThe [`git describe`](https://git-scm.com/docs/git-describe) command is a useful tool for versioning\na development build. However, it requires access to the full history of all tags and branches, which\ncan be a problem in workflows where you often work with shallow clones of repositories. This tool,\n`gh-describe`, retrieves the necessary historical information from the GitHub API instead of\nlocally, allowing you to use `git describe` as you normally would even in shallow clone\nrepositories.\n\n## Usage in GitHub Actions\n\n```yml\n- name: Git describe\n  id: ghd\n  uses: proudust/gh-describe@v2\n```\n\n### Action inputs\n\nAll inputs are optional, and sensible defaults will be used if they are not set.\n\n| Name       | Description                                           | Default                                                   |\n| ---------- | ----------------------------------------------------- | --------------------------------------------------------- |\n| token      | Personal Access Token (PAT)                           | `GITHUB_TOKEN`                                            |\n| repo       | Target repository                                     | The owner and repository that triggered the workflow run. |\n| commit-ish | Commit-ish object names to describe.                  | The branch or tag ref that triggered the workflow run.    |\n| match      | Only consider tags matching the given glob pattern.   |                                                           |\n| exclude    | Do not consider tags matching the given glob pattern. |                                                           |\n| default    | If the name is not found, use this value.             | If the name is not found, the action fails.               |\n\n### Action outputs\n\nThe following outputs can be used by subsequent workflow steps.\n\n| Name      | Description                                                | Example                                    |\n| --------- | ---------------------------------------------------------- | ------------------------------------------ |\n| describe  | `git describe --tags`-like description.                    | `v1.5.4-2-g4fdf9d0`                        |\n| tag       | The most recent tag.                                       | `v1.5.4`                                   |\n| distance  | The number of additional commits from the most recent tag. | `2`                                        |\n| sha       | The object name for the commit itself.                     | `4fdf9d0b88fe5f55e465ae947bca6b6b55c39415` |\n| short-sha | The object name for the commit itself.                     | `4fdf9d0`                                  |\n\nStep outputs can be accessed using the following example.\\\nNote that in order to read the step outputs, the action step must have an ID.\n\n```yml\n- name: Git describe\n  id: ghd\n  uses: proudust/gh-describe@v2\n- name: Check outputs\n  run: |\n    echo \"describe  : ${{ steps.ghd.outputs.describe }}\"\n    echo \"tag       : ${{ steps.ghd.outputs.tag }}\"\n    echo \"distance  : ${{ steps.ghd.outputs.distance }}\"\n    echo \"sha       : ${{ steps.ghd.outputs.sha }}\"\n    echo \"short-sha : ${{ steps.ghd.outputs.short-sha }}\"\n```\n\n## Usage on your terminal\n\n### GitHub CLI Extensions\n\nRequire [GitHub CLI](https://github.com/cli/cli#installation) and JavaScript Runtime\n([Deno](https://deno.land/#installation) or [Node.js](https://nodejs.org/)).\n\n```sh\ngh extensions install proudust/gh-describe\ngh describe\n```\n\n### Deno\n\nRequire [GitHub CLI](https://github.com/cli/cli#installation) and\n[Deno](https://deno.land/#installation).\n\n```sh\ndeno run --allow-run https://deno.land/x/gh_describe@v2.1.0/main.ts\n```\n\nor\n\n```sh\ndeno install -n gh-describe --allow-run https://deno.land/x/gh_describe@v2.1.0/main.ts\ngh-describe\n```\n\n### Self-contained executable\n\nRequire [GitHub CLI](https://github.com/cli/cli#installation). Download from\n[Release page](https://github.com/proudust/gh-describe/releases/latest).\n\nWindows:\n\n```cmd\ngh-describe-x86_64-pc-windows-msvc.exe\n```\n\nMac or Linux:\n\n```sh\n./gh-describe-aarch64-apple-darwin\n./gh-describe-x86_64-apple-darwin\n./gh-describe-x86_64-unknown-linux-gnu\n```\n\n### Help\n\n```sh\n$ gh describe --help\n  Usage:   gh-describe [commit-ish]\n  Version: v2.1.0\n\n  Description:\n\n    Emulate `git describe --tags` for shallow clone repositories.\n\n  Options:\n\n    -h, --help     - Show this help.\n    -V, --version  - Show the version number for this program.\n\n  Options like `git describe`:\n\n    --match       \u003cpattern...\u003e  - Only consider tags matching the given glob pattern.\n    --no-match                  - Clear and reset the list of match patterns.\n    --exclude     \u003cpattern...\u003e  - Do not consider tags matching the given glob pattern.\n    --no-exclude                - Clear and reset the list of exclude patterns.\n\n  Options for `gh`:\n\n    -R, --repo  \u003crepo\u003e  - Target repository. Format: OWNER/REPO\n\n  Other options:\n\n    --default  \u003ctag\u003e      - If the name is not found, use this value.\n    --runtime  \u003cruntime\u003e  - If installed by `gh extension install`, can specify the execution runtime.  (Values: \"deno\", \"node\")\n```\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproudust%2Fgh-describe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproudust%2Fgh-describe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproudust%2Fgh-describe/lists"}