github - 受保护的分支设置中的检查列表中缺少 Github 操作状态检查
问题描述
我有以下 github 操作设置,可以在创建拉取请求时正常触发。但它没有出现在受保护分支(主)的状态检查列表中。我不确定我做错了什么。
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/GitHub-Action-for-pylint@0.7.0
- name: Github Action for pytest
run: python3 testing.py
我也尝试过相同的设置:
on: [ pull_request ]
解决方案
终于想通了。我没有为作业设置名称,因此在这种情况下它默认为属性构建。我正在按工作流程名称搜索。添加作业名称后,我就能够正确搜索它。后来我还验证了搜索 build 也会在列表中显示检查名称。
jobs:
build:
name: python test
...
推荐阅读
- tensorflow - CUSTOM:操作正在处理不受支持的数据类型 EDGETPU
- r - 是否可以在 R 中使用 IF 或类似的东西来根据情况运行不同的代码行?
- ios - Xcode UI 测试:xcodebuild 无法在 xcode12 上生成 Coverage.profdata,失败并出现错误“错误:无法合并配置文件。”
- javascript - javascript onload 中的用户数
- android - 忽略某些构建变体的库模块编译
- python - python:管道循环错误进入列表而不中断循环
- php - Webhook 在 Laravel 框架中显示空值
- sql - 如何在不重复行的情况下获取日期以过滤到特定列。没有联盟可能吗?
- javascript - 使用动态创建的 id 标签定位元素
- javascript - 当我清理手表处理程序上的输入时,带有 v-model 的 Vuejs 输入未更新