Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

MegaLinter FILTER_REGEX_EXCLUDE excludes the whole .github/ tree via unanchored .git substring match

未关闭 适合新手
#9 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
yaml
领域
ci-cd, tooling

调研方向

从 .mega-linter.yml 开始,检查 FILTER_REGEX_EXCLUDE 如何应用于相对路径。更新排除模式,然后按照 issue 中的说明,通过 Docker 对 .github/** 运行 actionlint、yamllint、markdownlint-cli2 和 editorconfig-checker。完成标准是 .github/** 在 lint 时没有新增发现,并且所有报告的问题都已清理。

由索引模型根据 Issue 内容生成。

描述

`FILTER_REGEX_EXCLUDE` in `.mega-linter.yml` is unanchored:

FILTER_REGEX_EXCLUDE: (\.git|\.venv|\.pytest_cache|\.vscode|__pycache__)

MegaLinter matches this regex against each file's full relative path. The `.git` alternative matches any path containing the substring `.git`, which also matches everything under `.github/` (e.g. `.github/workflows/mega-linter.yml`, `.github/labels.yml`, `.github/codeql.yml`). As a result the whole `.github/` tree is silently excluded from every linter — actionlint, yamllint, markdownlint, editorconfig-checker, etc. never see workflow files, label config, dependabot config, or issue templates.

Since this repo is the template other repos are scaffolded from, the bug propagates to every repo created from it.

Fix: anchor each alternative to real directory boundaries:

FILTER_REGEX_EXCLUDE: (^|/)(\.git|\.venv|\.pytest_cache|\.vscode|__pycache__)/

This keeps `.git/`, `.venv/`, `pycache/`, etc. excluded while no longer matching `.github/` as a false positive.

See laywill/laywill.github.io#48 and its fix in laywill/laywill.github.io#50 for the original writeup and verification approach (ran actionlint/yamllint/markdownlint-cli2/editorconfig-checker locally against `.github/**` via Docker to confirm no new findings before merging).

Note: fixing this may turn linters loose on `.github/**` files that have never been linted before in downstream repos — expect the fix PR to also need to clean up whatever those linters newly report.

主要语言
没有语言数据
星标
2
派生
0
平均合并
53 分钟
30 天内合并 PR
4

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 DevOps Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。