如何仅在拉取请求分支的头提交上运行 github 操作?
有没有办法只能在功能分支的头部提交的拉动请求期间运行检查?
例如,如果我的分支看起来像这样:
- ticket-123:做一些工作
- 修复
- 程序修复
- 单元测试
,我希望此GitHub操作仅在ticket-123上运行:
目前做一些工作,我
name: 'Pull Request Commit Linter'
on:
- pull_request
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
尝试使用Fetch-Depth,使用1和2,但这无效。有建议吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该删除
fetch-depth:0
定义,因为我查找 repo,我在下面找到:如果您仅获取最新的提交,您的问题将得到解决。
You should remove
fetch-depth: 0
definition because I looked up the https://github.com/wagoid/commitlint-github-action repo and I found below sentence:If you fetch the latest commit only, your problem will be solved.