laywill / laywill/github-template

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

Open Beginner friendly
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
2
Forks
0
Avg merge
2d 3h
Merged PRs (30d)
3

Description

`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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in .mega-linter.yml and inspect how FILTER_REGEX_EXCLUDE is applied to relative paths. Update the exclusion pattern, then run actionlint, yamllint, markdownlint-cli2, and editorconfig-checker against .github/** via Docker as described in the issue. Done means .github/** is linted without new findings, with any reported issues cleaned up.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
ci-cd, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.