You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GitHub Actions工作流未显示,请求排查配置问题

GitHub Actions工作流未显示的排查要点
  • 检查文件命名与存放路径
    必须把YAML文件放在.github/workflows/目录下,文件名后缀得是.yml或.yaml,比如update-rss.yml。后缀不对或者放错目录,GitHub根本不会把它识别成工作流文件。

  • 修正YAML语法错误
    你当前的配置里有个明显的语法问题:workflow_dispatch字段下面不需要加branches子配置,这会导致YAML解析失败,GitHub无法识别工作流。正确的写法是直接写workflow_dispatch:即可。
    另外可以用本地的yamllint或者在线YAML校验工具检查整个配置,确保没有缩进错误、引号不匹配这类基础问题。

  • 确认触发分支匹配
    你的工作流只在main分支的推送事件和手动触发时运行,如果你的仓库默认分支不是main(比如是master),或者你推送代码到了其他分支,工作流不会触发。要对应修改push下的分支名,或者调整触发条件。

  • 检查仓库Actions权限设置
    进入仓库的Settings -> Actions -> General页面,确认:

    • Actions permissions设置为允许所有actions,或者至少允许你用到的官方action(比如actions/checkout、actions/setup-python)
    • 没有全局禁用GitHub Actions功能。
  • 查看工作流历史列表
    有时候工作流已经被识别但没触发,去仓库的Actions页面,切换到All workflows标签,看看能不能找到Update RSS feed这个工作流。如果能找到,手动触发workflow_dispatch测试一下是否能正常运行;定时任务则需要等待设定的时间点到了才会执行。


修正后的工作流配置示例

name: Update RSS feed

on:
  schedule:
    # 每天UTC时间22:32运行
    - cron: '32 22 * * *'
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  update-feed:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.9.6'

      - name: Install dependencies
        run: pip3 install -r requirements.txt

      - name: Generate RSS feed
        run: python3 feed-create.py

      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "Update filtered RSS feed"
          branch: ${{ github.ref }}
          commit_user_name: "GitHub Actions"
          commit_user_email: "actions@github.com"
          file_pattern: "filtered-rss-feed.xml"
          commit_options: "--no-verify --signoff"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

内容的提问来源于stack exchange,提问作者Remi Castonguay

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 11:35:40