From 70833cdab3df258819023a6870b706f8c6053ac5 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Fri, 16 Aug 2024 13:47:15 -0500 Subject: [PATCH] Switch markdownlint GH action to use super-linter --- .../linters/.markdownlint.json | 0 .github/linters/.markdownlintignore | 2 ++ .github/workflows/lint-code-base.yml | 30 +++++++++++++++++++ .../markdownlint-problem-matcher.json | 17 ----------- .github/workflows/markdownlint.yml | 29 ------------------ 5 files changed, 32 insertions(+), 46 deletions(-) rename .markdownlint.json => .github/linters/.markdownlint.json (100%) create mode 100644 .github/linters/.markdownlintignore create mode 100644 .github/workflows/lint-code-base.yml delete mode 100644 .github/workflows/markdownlint-problem-matcher.json delete mode 100644 .github/workflows/markdownlint.yml diff --git a/.markdownlint.json b/.github/linters/.markdownlint.json similarity index 100% rename from .markdownlint.json rename to .github/linters/.markdownlint.json diff --git a/.github/linters/.markdownlintignore b/.github/linters/.markdownlintignore new file mode 100644 index 0000000000..6db78fb289 --- /dev/null +++ b/.github/linters/.markdownlintignore @@ -0,0 +1,2 @@ +eng/readme-templates/* +eng/common/* diff --git a/.github/workflows/lint-code-base.yml b/.github/workflows/lint-code-base.yml new file mode 100644 index 0000000000..0ec63fcc3d --- /dev/null +++ b/.github/workflows/lint-code-base.yml @@ -0,0 +1,30 @@ +name: Lint Code Base + +on: + pull_request: null + +permissions: {} + +jobs: + run-lint: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + - name: Lint Code Base + uses: github/super-linter@v6 # https://github.com/github/super-linter + env: + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_ALL_CODEBASE: false + VALIDATE_MARKDOWN: true diff --git a/.github/workflows/markdownlint-problem-matcher.json b/.github/workflows/markdownlint-problem-matcher.json deleted file mode 100644 index f0741f6b90..0000000000 --- a/.github/workflows/markdownlint-problem-matcher.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "markdownlint", - "pattern": [ - { - "regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$", - "file": 1, - "line": 2, - "column": 3, - "code": 4, - "message": 5 - } - ] - } - ] -} diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml deleted file mode 100644 index e23df07b72..0000000000 --- a/.github/workflows/markdownlint.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: markdownlint - -permissions: - contents: read - -on: - pull_request: - paths: - - "**/*.md" - - "**/.markdownlint.json" - - ".github/workflows/markdownlint.yml" - - ".github/workflows/markdownlint-problem-matcher.json" - -jobs: - lint: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Run Markdownlint - run: | - echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json" - npm i -g markdownlint-cli - markdownlint "**/*.md" -i "eng/readme-templates/*" -i "eng/common/*"