Skip to content

Commit

Permalink
feat(workflow): Add reusable MarkdownLint workflow (#43)
Browse files Browse the repository at this point in the history
* feat(workflow): Add reusable MarkdownLint workflow

* introduce lint error to check job

* revert "introduce lint error to check job"

This reverts commit ce9137e.
  • Loading branch information
mircea-pavel-anton authored Sep 11, 2024
1 parent ad68966 commit fcd5a92
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/lint-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ jobs:
shellcheck:
uses: ./.github/workflows/reusable-shellcheck.yaml
secrets: inherit

markdownlint:
uses: ./.github/workflows/reusable-markdownlint.yaml
secrets: inherit
with:
markdownlint-cli-version: "0.41.0"
44 changes: 44 additions & 0 deletions .github/workflows/reusable-markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Reusable - Markdown Lint

on:
workflow_call:
inputs:
node-version:
description: "Node.js version"
type: string
required: false
default: "latest"
markdownlint-cli-version:
description: "markdownlint-cli version"
type: string
required: false
default: "latest"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"

- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
token: "${{ steps.app-token.outputs.token }}"

- name: Install Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: "${{ inputs.node-version }}"

- name: Install markdownlint-cli
run: npm install -g markdownlint-cli@${{ inputs.markdownlint-cli-version }}

- name: Run markdownlint
run: find . -name "*.md" -exec markdownlint {} +

0 comments on commit fcd5a92

Please sign in to comment.