百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

gh-find-current-pr

> 编程语言
开源

GitHub 操作用于与当前 SHA 关联的 Pull Request (PR)。

189 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

GitHub 操作用于与当前 SHA 关联的 Pull Request (PR)。

gh-find-current-pr

This action tries to figure out the current PR.

If the event is a pull_request, it's very easy to get the current PR number from the context via ${{ github.event.number }}, but unfortunately this information does not seem to be readily available for a push event. This action sends a request to GitHub to find the PR associated with the current SHA, and returns its number in the number output. number will be an empty string if there is no PR.

Additionally, title and body outputs are available as well to get the respective title and body of the PR.

By default, gh-find-current-pr will only return open PRs. You can pass in a state parameter to pick "open", "closed", or "all" PRs.

Usage

yaml
steps:
  - uses: actions/checkout@v4
  # Find the PR associated with this push, if there is one.
  - uses: jwalton/gh-find-current-pr@master
    id: findPr
    with:
      # Can be "open", "closed", or "all".  Defaults to "open".
      state: open
  # This will echo "Your PR is 7", or be skipped if there is no current PR.
  - run: echo "Your PR is ${PR}"
    if: success() && steps.findPr.outputs.number
    env:
      PR: ${{ steps.findPr.outputs.pr }}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言