已解决
使用 GitHub Actions 匹配提交信息自动关闭非法 PR
来自网友在路上 170870提问 提问时间:2023-09-20 21:51:15阅读次数: 70
最佳答案 问答题库708位专家为你答疑解惑
我维护的一个项目的仓库经常有误开 PR 的用户,每次都要一个个手动关闭,非常麻烦,遂设计了一个匹配提交信息自动关闭 PR 的工作流
pull.yaml
此工作流会在检测到提交信息为Update main.go
时自动关闭 PR。
name: PullLint
on:pull_request_target:types: [assigned, opened, synchronize, reopened]
jobs:# This workflow closes invalid PRclose-pr:name: closepr# The type of runner that the job will run onruns-on: ubuntu-latestpermissions: write-all# Steps represent a sequence of tasks that will be executed as part of the jobsteps:- name: Close PR if commit message is "Update main.go"if: github.event.pull_request.title == 'Update main.go'uses: superbrothers/close-pull-request@v3with:# Optional. Post a issue comment just before closing a pull request.comment: "Invalid PR."
查看全文
99%的人还看了
相似问题
猜你感兴趣
版权申明
本文"使用 GitHub Actions 匹配提交信息自动关闭非法 PR":http://eshow365.cn/6-10240-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!