{"id":23108185,"url":"https://github.com/prompt/actions-commit-hash","last_synced_at":"2026-04-02T17:07:18.647Z","repository":{"id":49429234,"uuid":"372908187","full_name":"prompt/actions-commit-hash","owner":"prompt","description":":octocat: Output commit hash (short and long) with an optional prefix","archived":false,"fork":false,"pushed_at":"2023-09-12T21:46:42.000Z","size":292,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-28T09:34:13.835Z","etag":null,"topics":["actions","git-metadata","github-actions"],"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/prompt.png","metadata":{"funding":{"github":"pr-mpt"},"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-06-01T17:16:29.000Z","updated_at":"2025-08-03T15:15:20.000Z","dependencies_parsed_at":"2024-10-24T16:51:14.848Z","dependency_job_id":"47f8827c-9afa-4ca9-bd62-dbc95ebac9c2","html_url":"https://github.com/prompt/actions-commit-hash","commit_stats":{"total_commits":12,"total_committers":4,"mean_commits":3.0,"dds":"0.41666666666666663","last_synced_commit":"6dbf7805b37d005ae7bbd77e9469ef31e2b21ae9"},"previous_names":["prompt/actions-commit-hash","pr-mpt/actions-commit-hash"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/prompt/actions-commit-hash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prompt%2Factions-commit-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prompt%2Factions-commit-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prompt%2Factions-commit-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prompt%2Factions-commit-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prompt","download_url":"https://codeload.github.com/prompt/actions-commit-hash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prompt%2Factions-commit-hash/sbom","scorecard":{"id":746912,"data":{"date":"2025-08-11","repo":{"name":"github.com/prompt/actions-commit-hash","commit":"6dbf7805b37d005ae7bbd77e9469ef31e2b21ae9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/package-action.yml:1","Warn: no topLevel permission defined: .github/workflows/sync-release-branch.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Warn: no topLevel permission defined: .github/workflows/validate-tag.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package-action.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/package-action.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package-action.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/package-action.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/package-action.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/package-action.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sync-release-branch.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/sync-release-branch.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-release-branch.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/sync-release-branch.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/validate-tag.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/validate-tag.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/validate-tag.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/validate-tag.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/validate-tag.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/prompt/actions-commit-hash/validate-tag.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/package-action.yml:20","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:18","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   9 third-party GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T19:05:38.922Z","repository_id":49429234,"created_at":"2025-08-22T19:05:38.923Z","updated_at":"2025-08-22T19:05:38.923Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31311160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["actions","git-metadata","github-actions"],"created_at":"2024-12-17T01:17:41.183Z","updated_at":"2026-04-02T17:07:18.642Z","avatar_url":"https://github.com/prompt.png","language":"TypeScript","funding_links":["https://github.com/sponsors/pr-mpt"],"categories":[],"sub_categories":[],"readme":"# Commit Hash\n\nA GitHub Action for using the long and short [hash of a commit][git/commits]\n\u0026mdash; with an optional prefix.\n\n```\nprompt/actions-commit-hash@v4\n```\n\n:package: [Automatic Release Packaging](#automatic-release-packaging) is used by\nthis action, please reference by tag or commit hash in your Workflows.\n\n## Inputs\n\nAll inputs are optional.\n\n| ID       | Description                                     | Default           | Examples                                   |\n| :------- | :---------------------------------------------- | :---------------- | :----------------------------------------- |\n| `commit` | Full, 40-character SHA-1 hash of the commit     | `${{github.sha}}` | `734713bc047d87bf7eac9674765ae793478c50d3` |\n| `prefix` | Optional string prepended to `short` and `long` |                   | `commit` `sha-`                            |\n\n## Outputs\n\n| ID      | Description                                                      | Examples                                                                                  |\n| :------ | :--------------------------------------------------------------- | :---------------------------------------------------------------------------------------- |\n| `short` | Short, 7-character hash of the commit with optional prefix       | `734713b` `sha-734713b`                                                                   |\n| `long`  | Full, 40-character SHA-1 hash of the commit with optional prefix | `734713bc047d87bf7eac9674765ae793478c50d3` `sha-734713bc047d87bf7eac9674765ae793478c50d3` |\n| `hash`  | Original, 40-character SHA-1 hash of the commit without prefix   | `734713bc047d87bf7eac9674765ae793478c50d3`                                                |\n\n## Examples\n\n### Build image with commit tag\n\n[docker/build-push-action] builds Docker images with tags, here we tag the image\nwe're building with the short commit hash.\n\n```yaml\njobs:\n  tag-image:\n    runs-on: ubuntu-latest\n    steps:\n    steps:\n      - id: commit\n        uses: prompt/actions-commit-hash@v4\n      - uses: docker/setup-buildx-action@v4\n      - name: Build image for commit\n        uses: docker/build-push-action@v7\n        with:\n          push: true\n          tags: ${{ steps.commit.outputs.short }}\n```\n\n### Prefix commit hash for `workflow_run` event\n\n[`workflow_run`][events/workflow_run] events are handled by Workflows within the\ncontext of the main branch, therefore the `github.sha` context value does not\nrepresent the commit that triggered the Workflow and we must use the `head_sha`\nvalue on the event instead.\n\n```yaml\non:\n  workflow_run:\n    workflows:\n      - Build\n    types:\n      - completed\n\njobs:\n  tag-image:\n    runs-on: ubuntu-latest\n    steps:\n    steps:\n      - id: commit\n        uses: prompt/actions-commit-hash@v4\n        with:\n          commit: \"${{ github.event.workflow_run.head_sha }}\"\n          prefix: \"sha-\"\n      - uses: docker/setup-buildx-action@v4\n      - name: Build image for commit\n        uses: docker/build-push-action@v7\n        with:\n          push: true\n          tags: ${{ steps.commit.outputs.short }}\n```\n\n## Automatic Release Packaging\n\nPackaging (creation of `dist`) happens automatically when a new tag is created.\nAny reference to this Action in a Workflow must use a [tag][tags] (mutable) or\nthe commit hash of a tag (immutable).\n\n```yaml\n✅ uses: prompt/actions-commit-hash@v4\n✅ uses: prompt/actions-commit-hash@v4.0.0\n✅ uses: prompt/actions-commit-hash@01d19a83c242e1851c9aa6cf9625092ecd095d09\n❌ uses: prompt/actions-commit-hash@main\n```\n\nThe blog post\n[Package GitHub Actions automatically with GitHub Actions][blog/package-automatically]\ndescribes how this is achieved.\n\n[git/commits]: https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History\n[docker/build-push-action]: https://github.com/docker/build-push-action\n[events/workflow_run]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run\n[blog/package-automatically]: https://medium.com/prompt/package-github-actions-automatically-with-github-actions-a70b9f7bae4\n[tags]: https://github.com/prompt/actions-commit-hash/tags\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprompt%2Factions-commit-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprompt%2Factions-commit-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprompt%2Factions-commit-hash/lists"}