{"id":50716781,"url":"https://github.com/8bitjonny/gh-get-current-pr","last_synced_at":"2026-06-09T19:00:51.819Z","repository":{"id":37024962,"uuid":"249225413","full_name":"8BitJonny/gh-get-current-pr","owner":"8BitJonny","description":"Github Action for getting all the details about the current Pull Request if the commit is part of one","archived":false,"fork":false,"pushed_at":"2026-01-28T10:26:53.000Z","size":2665,"stargazers_count":128,"open_issues_count":18,"forks_count":33,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-29T01:46:25.136Z","etag":null,"topics":["automation","ci-cd","github-action","github-actions","javascript","pull-requests","workflow"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/8BitJonny.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":"CODEOWNERS","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":"2020-03-22T16:33:30.000Z","updated_at":"2026-01-17T14:05:28.000Z","dependencies_parsed_at":"2023-01-05T13:17:03.240Z","dependency_job_id":"f62e1228-e3db-48a6-a00e-5afa032a4827","html_url":"https://github.com/8BitJonny/gh-get-current-pr","commit_stats":{"total_commits":223,"total_committers":11,"mean_commits":"20.272727272727273","dds":"0.42152466367713004","last_synced_commit":"f3ec11dfdff7bcbbaaced33fa333dc41da0c7349"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/8BitJonny/gh-get-current-pr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8BitJonny%2Fgh-get-current-pr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8BitJonny%2Fgh-get-current-pr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8BitJonny%2Fgh-get-current-pr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8BitJonny%2Fgh-get-current-pr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/8BitJonny","download_url":"https://codeload.github.com/8BitJonny/gh-get-current-pr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8BitJonny%2Fgh-get-current-pr/sbom","scorecard":{"id":6087,"data":{"date":"2025-08-11","repo":{"name":"github.com/8BitJonny/gh-get-current-pr","commit":"be4006a18cef68e4a3b3cf771439b0ca50c2a476"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/7 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":"Maintained","score":4,"reason":"4 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 4","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":"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":"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":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:29","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release-drafter.yml:17","Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/check-dist.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Warn: no topLevel permission defined: .github/workflows/rebuild-dist.yml:1","Warn: no topLevel permission defined: .github/workflows/release-drafter.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1"],"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":"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":"Pinned-Dependencies","score":9,"reason":"dependency not pinned by hash detected -- score normalized to 9","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/rebuild-dist.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/8BitJonny/gh-get-current-pr/rebuild-dist.yml/master?enable=pin","Info:  20 out of  20 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   3 third-party GitHubAction dependencies pinned","Info:   7 out of   7 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":"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":"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: GNU General Public License v3.0: 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":"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":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 24 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":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","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-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","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-14T13:35:11.302Z","repository_id":37024962,"created_at":"2025-08-14T13:35:11.302Z","updated_at":"2025-08-14T13:35:11.302Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34121022,"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-09T02:00:06.510Z","response_time":63,"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":["automation","ci-cd","github-action","github-actions","javascript","pull-requests","workflow"],"created_at":"2026-06-09T19:00:51.017Z","updated_at":"2026-06-09T19:00:51.813Z","avatar_url":"https://github.com/8BitJonny.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"left\"\u003e\n  \u003cimg height=\"30px\" src=\"https://forthebadge.com/images/badges/built-with-love.svg\"\u003e\n  \u003cimg height=\"30px\" src=\"https://github.com/8BitJonny/8BitJonny/blob/master/worksOnMyMachine.svg\"\u003e\n  \u003ca href=\"https://github.com/8BitJonny/gh-get-current-pr/actions/workflows/build.yml\"\u003e\n    \u003cimg src=\"https://github.com/8BitJonny/gh-get-current-pr/actions/workflows/build.yml/badge.svg\" alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/8BitJonny/gh-get-current-pr/actions/workflows/test.yml\"\u003e\n    \u003cimg src=\"https://github.com/8BitJonny/gh-get-current-pr/actions/workflows/test.yml/badge.svg\" alt=\"Test Status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/8BitJonny/gh-get-current-pr/blob/master/package.json\" alt=\"Version\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/8BitJonny/gh-get-current-pr.svg?display_name=tag\u0026sort=semver\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/8BitJonny/gh-get-current-pr/blob/master/LICENSE.md\" alt=\"License\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/8BitJonny/gh-get-current-pr.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Github Action: Get current PR\n\nGithub Action for checking if the current commit belongs to a pull request and returning the full PR object if that is the case\n\n## :thinking: Why?\n\nInside a running github action you can't always get the information whether you are currently in a PR or not. If for example the trigger event is `pull_request` you have that information but not when your trigger event is `push`.\n\nThis action enables you to get the PR no matter which event type triggered the workflow.\n\n## :keyboard: Usage\n\n```yml\n    steps:\n      - uses: 8BitJonny/gh-get-current-pr@4.0.0\n        id: PR\n\n      - run: echo \"Your PR number is ${{ steps.PR.outputs.number }} and its JSON is ${{ steps.PR.outputs.pr }}\"\n```\n\n### Inputs\nSee [action.yml](action.yml) for more details.\n```yml\n    steps:\n      - uses: 8BitJonny/gh-get-current-pr@4.0.0\n        id: PR\n        with:\n          # Authetication token to access GitHub APIs. (Can be omitted by default.)\n          github-token: ${{ github.token }}\n          # For which commit SHA the action should lookup a PR for (By default current commit)\n          sha: ${{ github.event.pull_request.head.sha }}\n          # Only return if PR is still open. (By default it returns PRs in any state.)\n          filterOutClosed: true\n          # Only return if PR is not in draft state. (By default it returns PRs in any state.)\n          filterOutDraft: true\n```\n\n### Outputs\nSee [action.yml](action.yml) for more details.\n```yml\n    steps:\n      - uses: 8BitJonny/gh-get-current-pr@4.0.0\n        id: PR\n\n      - run: echo \"PR ${prNumber} ${prTitle} at ${prUrl} is ${prJSON}\"\n        if: steps.PR.outputs.pr_found == 'true'\n        env:\n          # JSON object with the full PR object\n          # toJSON(fromJSON(...pr)) parses it into memory and then format is with pretty-print.\n          prJSON: ${{ toJSON(fromJSON(steps.PR.outputs.pr)) }}\n          # Direct access to common PR properties\n          prNumber: ${{ steps.PR.outputs.number }}\n          prUrl: ${{ steps.PR.outputs.pr_url }}\n          prTitle: ${{ steps.PR.outputs.pr_title }}\n          prBody: ${{ steps.PR.outputs.pr_body }}\n          prCreatedAt: ${{ steps.PR.outputs.pr_created_at }}\n          prMergedAt: ${{ steps.PR.outputs.pr_merged_at }}\n          prClosedAt: ${{ steps.PR.outputs.pr_closed_at }}\n          prLabel: ${{ steps.PR.outputs.pr_labels }}\n```\n\n### JSON output\nUseful when the information you're looking for is not exported as a direct output of the action. Simply parse the `pr` output as JSON and navigate the object.\nSee [GitHub Documentation](https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit) for details how the object looks like.\n```yml\n    steps:\n      - uses: 8BitJonny/gh-get-current-pr@4.0.0\n        id: PR\n\n      - name: \"Pull Request ${{ steps.PR.outputs.number }}\"\n        if: steps.PR.outputs.pr_found == 'true'\n        run: |\n          echo \"from ${{ fromJSON(steps.PR.outputs.pr).head.ref }}\"\n          echo \"to ${{ fromJSON(steps.PR.outputs.pr).base.ref }}\"\n```\n\n## Limitations\n\n### Can't find closed, unmerged PRs\nCurrently, if you try to find a PR that hasn't been merged yet AND which has been closed, then this app will completely fail in finding that PR. This workflow can only find open PRs, draft PRs and closed+merged PRs.\n\nSee https://github.com/8BitJonny/gh-get-current-pr/issues/165 for the progress on this issue as this might come in a later version.\n\n\n## :computer: Contributing\nContributions are always welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8bitjonny%2Fgh-get-current-pr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F8bitjonny%2Fgh-get-current-pr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8bitjonny%2Fgh-get-current-pr/lists"}