英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论