Skip to content

feat(ci): add org-default markdownlint config with workflow fallback#91

Merged
JacobPEvans merged 3 commits intomainfrom
feature/org-default-markdownlint-config
Mar 14, 2026
Merged

feat(ci): add org-default markdownlint config with workflow fallback#91
JacobPEvans merged 3 commits intomainfrom
feature/org-default-markdownlint-config

Conversation

@JacobPEvans
Copy link
Owner

@JacobPEvans JacobPEvans commented Mar 14, 2026

Summary

  • Add org-wide markdownlint defaults at configs/.markdownlint-cli2.yaml
  • Update _markdown-lint.yml to auto-download org defaults when repos lack local config
  • Repos can still provide their own .markdownlint-cli2.yaml for overrides
  • Default handles release-please CHANGELOG patterns (MD024 siblings_only, MD013 for CHANGELOG.md)

Test plan

Greptile Summary

This PR introduces an org-wide markdownlint config fallback mechanism. The reusable _markdown-lint.yml workflow now checks whether the calling repo has any local markdownlint config; if not, it downloads the org default from configs/.markdownlint-cli2.yaml. The default config is minimal and pragmatic — it relaxes MD024 to allow sibling duplicate headings (standard for changelogs) and disables MD013 line-length enforcement specifically for CHANGELOG.md files generated by release-please.

  • The hashFiles guard in the workflow is missing .markdownlint-cli2.jsonc — the primary config format for markdownlint-cli2 — along with .markdownlint.cjs and .markdownlint.mjs. A repo using any of these would have its config silently overwritten by the org default.
  • The curl fallback approach using ${{ github.repository_owner }} is a nice touch for fork compatibility.
  • The new configs/.markdownlint-cli2.yaml is clean, well-commented, and follows the markdownlint-cli2 schema correctly.

Confidence Score: 3/5

  • Safe to merge after addressing the incomplete hashFiles guard — low blast radius but worth fixing to prevent subtle config override bugs
  • The core concept is solid and the config file is correct. However, the missing .markdownlint-cli2.jsonc (and two other formats) in the hashFiles check is a real bug that could silently overwrite a repo's local config. This isn't a showstopper for the current org repos (which use .markdownlint.json), but it's a latent issue for any repo that adopts the primary markdownlint-cli2 config format.
  • .github/workflows/_markdown-lint.yml — the hashFiles condition needs the complete set of markdownlint config filenames

Important Files Changed

Filename Overview
.github/workflows/_markdown-lint.yml Adds org-default config fallback step with hashFiles guard, but the guard is missing .markdownlint-cli2.jsonc (the primary config format) plus .markdownlint.cjs and .markdownlint.mjs, which could cause silent config overwrites in repos using those formats.
configs/.markdownlint-cli2.yaml New org-wide markdownlint defaults config. Clean YAML with sensible rules: MD024 siblings_only for changelogs and MD013 disabled for CHANGELOG.md to accommodate release-please output. No issues found.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Calling repo triggers _markdown-lint.yml] --> B[Checkout repo]
    B --> C{hashFiles checks:\nany local markdownlint config?}
    C -->|Config found| E[Run markdownlint-cli2\nwith local config]
    C -->|No config found| D["curl org default from\nconfigs/.markdownlint-cli2.yaml"]
    D --> E
    E --> F{Lint result}
    F -->|Pass| G[✅ Job succeeds]
    F -->|Fail| H[❌ Job fails with violations]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: .github/workflows/_markdown-lint.yml
Line: 24

Comment:
**Missing `.markdownlint-cli2.jsonc` in hashFiles check**

The `hashFiles` guard is missing `.markdownlint-cli2.jsonc`, which is the **primary** config format for markdownlint-cli2 (it's the first one the tool searches for). If a repo uses `.markdownlint-cli2.jsonc` for its config, this condition will evaluate to `''` and the org default will overwrite it.

Also missing are `.markdownlint.cjs` and `.markdownlint.mjs` — both valid markdownlint config formats.

The full set of supported config filenames per [markdownlint-cli2 docs](https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc) is:
- `.markdownlint-cli2.jsonc`, `.markdownlint-cli2.yaml`, `.markdownlint-cli2.cjs`, `.markdownlint-cli2.mjs`
- `.markdownlint.jsonc`, `.markdownlint.json`, `.markdownlint.yaml`, `.markdownlint.yml`, `.markdownlint.cjs`, `.markdownlint.mjs`

```suggestion
        if: hashFiles('.markdownlint-cli2.jsonc', '.markdownlint-cli2.yaml', '.markdownlint-cli2.cjs', '.markdownlint-cli2.mjs', '.markdownlint.jsonc', '.markdownlint.json', '.markdownlint.yaml', '.markdownlint.yml', '.markdownlint.cjs', '.markdownlint.mjs') == ''
```

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: b921213

Greptile also left 1 inline comment on this PR.

Copilot AI review requested due to automatic review settings March 14, 2026 11:38
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a standardized markdownlint configuration for the organization, improving consistency in documentation and markdown files across various repositories. It introduces a central default configuration while maintaining flexibility for individual projects to customize rules. This change streamlines the CI process by automatically applying these standards and specifically addresses compatibility with "release-please" generated changelogs.

Highlights

  • New Organization-wide Markdownlint Configuration: Introduced a new organization-wide markdownlint default configuration file at "configs/.markdownlint-cli2.yaml" to standardize linting rules across repositories.
  • Flexible Overrides: Enabled repositories to provide their own ".markdownlint-cli2.yaml" file to override or extend the organization's default settings, allowing for project-specific adjustments.
  • Release-Please Compatibility: Configured the default markdownlint rules to accommodate common patterns generated by "release-please", specifically by allowing duplicate headings (MD024) and disabling long line checks (MD013) for "CHANGELOG.md" files.
  • CI Workflow Integration: Integrated the new configuration with the "_markdown-lint.yml" reusable workflow, which will now automatically download and apply these organization defaults to repositories that do not have a local markdownlint configuration.
Changelog
  • configs/.markdownlint-cli2.yaml
    • Added a new organization-wide markdownlint configuration file.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/_markdown-lint.yml
Activity
  • No specific review comments or discussions have been recorded yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Code clean and neat, Markdown shines, no errors found, CI gives its nod.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an organization-default markdownlint-cli2 configuration and updates the reusable Markdown lint workflow to automatically use it when a calling repository does not define its own markdownlint config.

Changes:

  • Add org-wide markdownlint defaults at configs/.markdownlint-cli2.yaml (including CHANGELOG-specific overrides).
  • Update .github/workflows/_markdown-lint.yml to download the org-default config when no local markdownlint config is present.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
configs/.markdownlint-cli2.yaml Adds baseline markdownlint rules and per-file overrides (e.g., CHANGELOG).
.github/workflows/_markdown-lint.yml Adds a fallback step to fetch the org-default config before running markdownlint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Set line_length to 160 (strict), with 80 for code blocks and headings.
Tables checked at 160 like general content. CHANGELOG.md remains exempt.

(claude)
@JacobPEvans JacobPEvans merged commit d3cbf9f into main Mar 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants