XS✔ ◾ [⚠️Don't merge] Testing new markdown action #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate-Markdown | |
on: | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '**.md' # This ensures the workflow only runs if there's a change in any Markdown files | |
workflow_dispatch: | |
jobs: | |
validate-markdown: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
issues: write | |
repository-projects: read | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
# Step to get a list of all the changed Markdown files | |
- name: Get changed files | |
id: files | |
uses: lots0logs/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# Step to lint only the changed Markdown files | |
- name: Lint Markdown files | |
uses: articulate/actions-markdownlint@v1 | |
with: | |
config: ./.markdownlint/config.json | |
files: ${{ steps.files.outputs.all }} # This passes the list of changed files to the linter |