gpt4 book ai didi

github-actions - 如何获取 GitHub 拉取请求 ID 号

转载 作者:行者123 更新时间:2023-12-05 00:55:57 27 4
gpt4 key购买 nike

有没有办法获取 Github 的拉取请求编号(例如 PR #323)并将其设置到 Github Actions 的环境变量中(不带标签)?

env:
GITHUB_PR_NUMBER: 323

最佳答案

on:
pull_request

env:
GITHUB_PR_NUMBER: ${{github.event.pull_request.number}}
jobs:
prJob:
name: Print event
runs-on: ubuntu-latest
steps:
- run: |
echo "$GITHUB_PR_NUMBER"

有关详细信息,请参阅 https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request

关于github-actions - 如何获取 GitHub 拉取请求 ID 号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63315089/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com