1
0
mirror of synced 2025-12-30 03:01:36 -05:00
Files
docs/.github/workflows/content-lint-markdown.yml
dependabot[bot] 0c3beb57b9 Bump tj-actions/changed-files from 39.0.1 to 40.0.2 (#45468)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-02 16:25:31 +00:00

42 lines
1.5 KiB
YAML

name: 'Content Lint Markdown'
# **What it does**: Lints our content markdown to ensure the content matches the specified styleguide.
# **Why we have it**: We want some level of consistency to our content markdown files.
# **Who does it impact**: Docs content writers.
on:
pull_request:
merge_group:
permissions:
contents: read
jobs:
lint-content:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ${{ fromJSON('["ubuntu-latest", "ubuntu-20.04-xl"]')[github.repository == 'github/docs-internal'] }}
steps:
- name: Check out repo
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
# Picking this number is a "best guess". If we make it too large,
# the checkout will take potentially unnecessariily long.
# This reduces the chance that tj-actions/changed-files has to
# fetch deeper history. But if it needs to, it will.
fetch-depth: 10
- name: Set up Node and dependencies
uses: ./.github/actions/node-npm-setup
- name: Get changed content/data files
id: changed-files
uses: tj-actions/changed-files@40526807ee1e208a1a8c1bbe6bd2d1b044ef6368 # v40.0.2
with:
files: |
content/**
data/**
- name: Run content linter if changed content/data files
if: steps.changed-files.outputs.any_changed == 'true'
run: npm run lint-content -- --errors-only --paths ${{ steps.changed-files.outputs.all_changed_files }}