pull_request_target Github Action not triggering

huangapple go评论52阅读模式
英文:

pull_request_target Github Action not triggering

问题

我正在创建一个新的GitHub Action工作流程,在我的存储库中,使用pull_request_target触发器来在关闭拉取请求时(用于清理分支到主分支的分配资源)触发。但是当我关闭拉取请求时(使用GitHub中的关闭拉取请求按钮),它没有触发。我找不到我操作的问题在哪里。

name: 拉取请求关闭工作流程

on:
  pull_request_target:
    types:
      - closed

jobs:
  target_test:
    runs-on: ubuntu-20.04
    steps:
      - name: 输出
        run: |
                  输出 "你好,世界!"
英文:

I am creating a new GitHub Action workflow in my repository with the pull_request_target trigger on the closing of a pull request (to clean up allocated resources) from a branch to master. But it isn't triggering when I close the pull request (using the close pull request button in GitHub). I can't find what I'm doing wrong with my action

name: Pull request closing workflow

on:
  pull_request_target:
    types:
      - closed

jobs:
  target_test:
    runs-on: ubuntu-20.04
    steps:
      - name: echo 
        run: |
                  echo "HELLO WORLD!"

答案1

得分: 0

回答自己的问题。pull_request_target 触发器只从主分支运行,而我还没有合并我的 PR,所以它无法触发。我合并了代码,然后它正常工作了。

英文:

Answering my own question. The pull_request_target trigger only runs from the master branch and I hadn't merged my PR yet, so it couldn't trigger. I merged the code and then it worked fine.

huangapple
  • 本文由 发表于 2023年4月20日 04:09:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76058442.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定