Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 235 additions & 0 deletions .github/workflows/markdown-linter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
---
name: "Markdown Linter"
description: >
Runs Markdown quality checks using Super Linter and creates issues
for violations found across the repository.

Comment on lines +1 to +6

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This PR adds a new agentic workflow source file, but there is no corresponding compiled .lock.yml workflow. Since GitHub only executes YAML workflows, this workflow won’t run on schedule/dispatch until the repo also includes the compiled markdown-linter.lock.yml generated via gh aw compile (and committed under .github/workflows/).

Copilot uses AI. Check for mistakes.
on:
workflow_dispatch:
schedule:
- cron: "0 14 * * 1-5" # 2 PM UTC, weekdays only

# ###############################################################
# Override the COPILOT_GITHUB_TOKEN secret usage for the workflow
# with a randomly-selected token from a pool of secrets.
#
# As soon as organization-level billing is offered for Agentic
# Workflows, this stop-gap approach will be removed.
#
# See: /.github/actions/select-copilot-pat/README.md
# ###############################################################
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
name: Checkout the select-copilot-pat action folder
with:
persist-credentials: false
sparse-checkout: .github/actions/select-copilot-pat
sparse-checkout-cone-mode: true
fetch-depth: 1

- id: select-copilot-pat
name: Select Copilot token from pool
uses: ./.github/actions/select-copilot-pat
env:
SECRET_0: ${{ secrets.COPILOT_GITHUB_TOKEN }}
SECRET_1: ${{ secrets.COPILOT_GITHUB_TOKEN_2 }}
SECRET_2: ${{ secrets.COPILOT_GITHUB_TOKEN_3 }}
SECRET_3: ${{ secrets.COPILOT_GITHUB_TOKEN_4 }}
SECRET_4: ${{ secrets.COPILOT_GITHUB_TOKEN_5 }}
SECRET_5: ${{ secrets.COPILOT_GITHUB_TOKEN_6 }}
SECRET_6: ${{ secrets.COPILOT_GITHUB_TOKEN_7 }}
SECRET_7: ${{ secrets.COPILOT_GITHUB_TOKEN_8 }}

# Don't run scheduled triggers on forked repositories — forks lack the
# secrets and context required, and scheduled runs would consume the
# fork owner's minutes.
if: ${{ !(github.event_name == 'schedule' && github.event.repository.fork) }}

# Add the pre-activation output of the randomly selected PAT
jobs:
pre-activation:
outputs:
copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }}

super_linter:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- name: Super-linter
uses: super-linter/super-linter@v8.5.0

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

super-linter/super-linter is referenced by a version tag (v8.5.0) rather than a pinned commit SHA. This repo’s workflows generally pin actions to SHAs for supply-chain integrity; please pin Super Linter to a specific SHA (and keep the version in a comment if desired).

This issue also appears in the following locations of the same file:

  • line 92
  • line 141
Suggested change
uses: super-linter/super-linter@v8.5.0
uses: super-linter/super-linter@<FULL_LENGTH_COMMIT_SHA_FOR_V8_5_0> # v8.5.0

Copilot uses AI. Check for mistakes.
id: super-linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CREATE_LOG_FILE: "true"
LOG_FILE: super-linter.log
Comment on lines +67 to +73

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The Super Linter step will typically exit non-zero when it finds lint violations, which would fail the super_linter job. Since the intent here is to always produce a report/issue from the log, consider making this step non-fatal (e.g., continue-on-error: true) and rely on the log parsing to drive whether an issue is created.

Copilot uses AI. Check for mistakes.
DEFAULT_BRANCH: main
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: "true"
VALIDATE_MARKDOWN: "true"
VALIDATE_ALL_CODEBASE: "false"

Comment on lines +74 to +78

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow description says it reports violations found “across the repository”, but Super Linter is configured with VALIDATE_ALL_CODEBASE: "false". If the goal is a full repo scan on the scheduled run, this setting likely conflicts with that intent; consider enabling full-codebase validation (or adjust the description to match the intended scope).

Copilot uses AI. Check for mistakes.
- name: Check for linting issues
id: check-results
run: |
if [ -f "super-linter.log" ] && [ -s "super-linter.log" ]; then
if grep -qE "ERROR|WARN|FAIL" super-linter.log; then
echo "needs-linting=true" >> "$GITHUB_OUTPUT"
else
echo "needs-linting=false" >> "$GITHUB_OUTPUT"
fi
else
echo "needs-linting=false" >> "$GITHUB_OUTPUT"
fi

Comment on lines +79 to +91

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The check-results step computes a needs-linting output, but nothing in this workflow consumes it. Either wire this output into the agent run (to skip analysis when clean) or remove the step/output to avoid dead code and confusion.

Suggested change
- name: Check for linting issues
id: check-results
run: |
if [ -f "super-linter.log" ] && [ -s "super-linter.log" ]; then
if grep -qE "ERROR|WARN|FAIL" super-linter.log; then
echo "needs-linting=true" >> "$GITHUB_OUTPUT"
else
echo "needs-linting=false" >> "$GITHUB_OUTPUT"
fi
else
echo "needs-linting=false" >> "$GITHUB_OUTPUT"
fi

Copilot uses AI. Check for mistakes.
- name: Upload super-linter log
if: always()
uses: actions/upload-artifact@v7
with:
name: super-linter-log
path: super-linter.log
retention-days: 7

# Override the COPILOT_GITHUB_TOKEN expression used in the activation job
engine:
id: copilot
env:
COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_GITHUB_TOKEN, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_GITHUB_TOKEN_2, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_GITHUB_TOKEN_3, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_GITHUB_TOKEN_4, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_GITHUB_TOKEN_5, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_GITHUB_TOKEN_6, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_GITHUB_TOKEN_7, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_GITHUB_TOKEN_8, secrets.COPILOT_GITHUB_TOKEN) }}

permissions:
contents: read
actions: read
issues: read

tools:
cache-memory: true
edit:
bash:
- "cat"
- "grep"
- "head"
- "tail"
- "find"
- "ls"
- "wc"
- "sort"
- "uniq"

safe-outputs:
create-issue:
expires: 2d
title-prefix: "[linter] "
labels: [automation, code-quality]
max: 1
noop:
report-as-issue: false

network:
allowed:
- defaults

timeout-minutes: 15

steps:
- name: Download super-linter log
uses: actions/download-artifact@v8
with:
name: super-linter-log
path: /tmp/gh-aw/
---

# Markdown Quality Report

You are an expert documentation quality analyst. Your task is to analyze the
Super Linter Markdown output and create a comprehensive issue report for the
repository maintainers.

## Context

- **Repository**: ${{ github.repository }}
- **Triggered by**: @${{ github.actor }}
- **Run ID**: ${{ github.run_id }}

## Your Task

1. **Read the linter output** from `/tmp/gh-aw/super-linter.log` using the bash tool
2. **Analyze the findings**:
- Categorize errors by severity (critical, high, medium, low)
- Identify patterns in the errors
- Determine which errors are most important to fix first
- Note: This workflow only validates Markdown files
3. **Create a detailed issue** with the following structure:

### Issue Title

Use format: "Markdown Quality Report - [Date] - [X] issues found"

### Issue Body Structure

```markdown
## 🔍 Markdown Linter Summary

**Date**: [Current date]
**Total Issues Found**: [Number]
**Run ID**: ${{ github.run_id }}

## 📊 Breakdown by Severity

- **Critical**: [Count and brief description]
- **High**: [Count and brief description]
- **Medium**: [Count and brief description]
- **Low**: [Count and brief description]

## 📁 Issues by Category

### [Category/Rule Name]
- **File**: `path/to/file`
- Line [X]: [Error description]
- Suggested fix: [How to resolve]

[Repeat for other categories]

## 🎯 Priority Recommendations

1. [Most critical issue to address first]
2. [Second priority]
3. [Third priority]

## 📋 Full Linter Output

<details>
<summary>Click to expand complete linter log</summary>

```
[Include the full linter output here]
```

</details>

## 🔗 References

- [Link to workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
- [Super Linter Documentation](https://github.com/super-linter/super-linter)
```

## Important Guidelines

- **Be concise but thorough**: Focus on actionable insights
- **Prioritize issues**: Not all linting errors are equal
- **Provide context**: Explain why each type of error matters for documentation quality
- **Suggest fixes**: Give practical recommendations
- **Use proper formatting**: Make the issue easy to read and navigate
- **If no errors found**: Call `noop` celebrating clean markdown

**Important**: Always call exactly one safe-output tool before finishing (`create_issue` or `noop`).

```json
{"noop": {"message": "No action needed: [brief explanation of what was analyzed and why]"}}
```