受保护分支设置中的检查列表中缺少 Github 操作状态检查

2024-05-13

我有以下 github 操作设置,可以在创建 Pull 请求时正常触发。但它不会出现在受保护分支(主分支)的状态检查列表中。我不确定我做错了什么。


name: Python application

on:
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python 3.7
      uses: actions/setup-python@v1
      with:
        python-version: 3.7
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
    - name: Lint with flake8
      run: |
        pip install flake8
        # stop the build if there are Python syntax errors or undefined names
        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
    - name: GitHub Action for pylint
      uses: cclauss/[email protected] /cdn-cgi/l/email-protection
    - name: Github Action for pytest
      run: python3 testing.py

我也尝试过相同的设置:

on: [ pull_request ]

Edit: Screenshot of the check missing: enter image description here


终于明白了这一点。我没有为该作业设置名称,因此在本例中它默认为属性构建。我正在按工作流程名称搜索。添加职位名称后,我就可以正确搜索它。后来我还验证了搜索 build 也会在列表中显示检查名称。

jobs:
  build:
    name: python test
...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

受保护分支设置中的检查列表中缺少 Github 操作状态检查 的相关文章

随机推荐