{"id":21471157,"url":"https://github.com/im-open/verify-git-ref","last_synced_at":"2025-03-17T06:46:19.883Z","repository":{"id":43059672,"uuid":"409717200","full_name":"im-open/verify-git-ref","owner":"im-open","description":"Action that checks a git repository to see if a branch, tag or SHA exist","archived":false,"fork":false,"pushed_at":"2023-10-16T21:03:25.000Z","size":49,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-23T16:14:54.206Z","etag":null,"topics":["branch","code","infra-purple-team","tag"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/im-open.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":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2021-09-23T19:19:55.000Z","updated_at":"2024-08-21T14:18:11.000Z","dependencies_parsed_at":"2022-09-09T16:50:42.830Z","dependency_job_id":null,"html_url":"https://github.com/im-open/verify-git-ref","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":"im-open/composite-action-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/im-open%2Fverify-git-ref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/im-open%2Fverify-git-ref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/im-open%2Fverify-git-ref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/im-open%2Fverify-git-ref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/im-open","download_url":"https://codeload.github.com/im-open/verify-git-ref/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243988961,"owners_count":20379649,"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":["branch","code","infra-purple-team","tag"],"created_at":"2024-11-23T09:32:05.338Z","updated_at":"2025-03-17T06:46:19.861Z","avatar_url":"https://github.com/im-open.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# verify-git-ref\n\nThis action can be used to verify whether a git ref (branch/tag/sha) exists in a repository. By default this action will exit with a code of 1 if the provided ref does not appear to exist. This behavior can be changed by setting the `throw-errors` flag to false.\n\n## Index \u003c!-- omit in toc --\u003e\n\n- [verify-git-ref](#verify-git-ref)\n  - [Prerequisites](#prerequisites)\n  - [Inputs](#inputs)\n  - [Outputs](#outputs)\n  - [Usage Examples](#usage-examples)\n  - [Contributing](#contributing)\n    - [Incrementing the Version](#incrementing-the-version)\n    - [Source Code Changes](#source-code-changes)\n    - [Updating the README.md](#updating-the-readmemd)\n    - [Tests](#tests)\n  - [Code of Conduct](#code-of-conduct)\n  - [License](#license)\n\n## Prerequisites\n\nThis action requires that the `actions/checkout` action has run and a `fetch-depth: 0` has been set. The action cannot examine the tags and branches of the repository unless they've been pulled down.\n\n## Inputs\n\n| Parameter        | Is Required | Default | Description                                                                                                         |\n|------------------|-------------|---------|---------------------------------------------------------------------------------------------------------------------|\n| `branch-tag-sha` | true        | N/A     | The GitHub ref (branch/tag/sha) that should be checked.                                                             |\n| `throw-errors`   | false       | `true`  | Flag indicating whether the action should throw an error if the ref does not exist. Accepted values: `true\\|false`. |\n\n## Outputs\n\n| Output       | Description                                                                       |\n|--------------|-----------------------------------------------------------------------------------|\n| `REF_EXISTS` | Flag indicating whether the provided reference exists: `true\\|false`              |\n| `REF_TYPE`   | String indicating the type of the provided reference: `tag\\|branch\\|sha\\|unknown` |\n\n## Usage Examples\n\n```yml\nname: Deploy to Dev\non:\n  workflow_dispatch:\n    inputs:\n      branch-tag-sha:\n        description: \"The branch/tag/sha to deploy\"\n        required: true\njobs:\n  check:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n\n      - name: verify version exists before deploying\n        # You may also reference just the major or major.minor version\n        uses: im-open/verify-git-ref@v1.2.1\n        with:\n          branch-tag-sha: ${{ github.event.inputs.branch-tag-sha }}\n\n      - name: Deploy\n        run: ./deploy-to-dev.sh\n```\n\n## Contributing\n\nWhen creating PRs, please review the following guidelines:\n\n- [ ] The action code does not contain sensitive information.\n- [ ] At least one of the commit messages contains the appropriate `+semver:` keywords listed under [Incrementing the Version] for major and minor increments.\n- [ ] The README.md has been updated with the latest version of the action.  See [Updating the README.md] for details.\n- [ ] Any tests in the [build-and-review-pr] workflow are passing\n\n### Incrementing the Version\n\nThis repo uses [git-version-lite] in its workflows to examine commit messages to determine whether to perform a major, minor or patch increment on merge if [source code] changes have been made.  The following table provides the fragment that should be included in a commit message to active different increment strategies.\n\n| Increment Type | Commit Message Fragment                     |\n|----------------|---------------------------------------------|\n| major          | +semver:breaking                            |\n| major          | +semver:major                               |\n| minor          | +semver:feature                             |\n| minor          | +semver:minor                               |\n| patch          | *default increment type, no comment needed* |\n\n### Source Code Changes\n\nThe files and directories that are considered source code are listed in the `files-with-code` and `dirs-with-code` arguments in both the [build-and-review-pr] and [increment-version-on-merge] workflows.  \n\nIf a PR contains source code changes, the README.md should be updated with the latest action version.  The [build-and-review-pr] workflow will ensure these steps are performed when they are required.  The workflow will provide instructions for completing these steps if the PR Author does not initially complete them.\n\nIf a PR consists solely of non-source code changes like changes to the `README.md` or workflows under `./.github/workflows`, version updates do not need to be performed.\n\n### Updating the README.md\n\nIf changes are made to the action's [source code], the [usage examples] section of this file should be updated with the next version of the action.  Each instance of this action should be updated.  This helps users know what the latest tag is without having to navigate to the Tags page of the repository.  See [Incrementing the Version] for details on how to determine what the next version will be or consult the first workflow run for the PR which will also calculate the next version.\n\n### Tests\n\nThe build and review PR workflow includes tests which are linked to a status check. That status check needs to succeed before a PR is merged to the default branch.  The tests do not need special permissions, so they should succeed whether they come from a branch or a fork.\n\n## Code of Conduct\n\nThis project has adopted the [im-open's Code of Conduct](https://github.com/im-open/.github/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nCopyright \u0026copy; 2023, Extend Health, LLC. Code released under the [MIT license](LICENSE).\n\n\u003c!-- Links --\u003e\n[Incrementing the Version]: #incrementing-the-version\n[Updating the README.md]: #updating-the-readmemd\n[source code]: #source-code-changes\n[usage examples]: #usage-examples\n[build-and-review-pr]: ./.github/workflows/build-and-review-pr.yml\n[increment-version-on-merge]: ./.github/workflows/increment-version-on-merge.yml\n[git-version-lite]: https://github.com/im-open/git-version-lite\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-open%2Fverify-git-ref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fim-open%2Fverify-git-ref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-open%2Fverify-git-ref/lists"}