工作流程在我的项目中没有被触发



我想在我的GitHub项目中使用这个工作流,https://github.com/webex/pr-title-checker上面一个如果是从https://github.com/thehanimo/pr-title-checker

派生的我创建了

配置文件.github/pr-title-checker-config.json

{
"LABEL": {
"name": "Title needs formatting",
"color": "EEEEEE"
},
"CHECKS": {
"prefixes": ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "test"],
"regexp": "docs\(v[0-9]\): ",
"regexpFlags": "i",
"ignoreLabels" : ["dont-check-PRs-with-this-label", "meta"]
},
"MESSAGES": {
"success": "All OK",
"failure": "Failing CI test",
"notice": ""
}
}

工作流文件.github/workflows/pr-title-checker.yml

name: "PR Title Checker"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: webex/pr-title-checker
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
configuration_path: ".github/pr-title-checker-config.json"

但是我注意到我的工作流程没有被触发。有人能帮帮我吗?之前它是触发的,但现在它是/

我希望我的工作流应该总是在任何更改,推送,pr标题更新等任何分支上触发(我的代码存在于beta分支)

谢谢。

在做了一些研究和更改之后,我能够运行带有pr标题检查的工作流,

几个基本要点需要了解-

  1. 工作流是由一个YAML文件定义的,在使用之前总是验证你的yml,有时因为格式化它没有触发事件。

  2. - uses:提供正确的值用于使用,标签,分支和shas只应该使用https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions using-release-management-for-your-custom-actions

  3. 始终使用正确的事件,https://docs.github.com/en/actions/using-workflows/triggering-a-workflow using-filters-to-target-specific-branches-for-pull-request-events

更新后的代码如下-

# This workflow/action checks if PR titles conform to the Contribution Guidelines
# For more information, see: https://github.com/webex/pr-title-checker
name: pr-title-checker
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
branches:
- main
- dev
- beta
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check PR title
uses: webex/pr-title-checker@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
configuration_path: .github/pr-title-checker-config.json

最新更新