|
| 1 | +name: Quality Gates |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: [ develop ] |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +jobs: |
| 8 | + gates: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + permissions: |
| 11 | + contents: read |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + - name: Setup Node |
| 15 | + uses: actions/setup-node@v4 |
| 16 | + with: { node-version: '20' } |
| 17 | + |
| 18 | + - name: Install tools |
| 19 | + run: | |
| 20 | + npm install --no-save markdownlint-cli ajv ajv-formats yaml |
| 21 | + pipx install yamllint |
| 22 | + curl -sSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash -s -- -b $HOME/bin |
| 23 | + echo "$HOME/bin" >> $GITHUB_PATH |
| 24 | +
|
| 25 | + - name: Changed files |
| 26 | + id: changed |
| 27 | + uses: tj-actions/changed-files@v45 |
| 28 | + |
| 29 | + - name: Changed Markdown files |
| 30 | + id: changed_md |
| 31 | + uses: tj-actions/changed-files@v45 |
| 32 | + with: |
| 33 | + files: '**/*.md' |
| 34 | + |
| 35 | + - name: yamllint |
| 36 | + if: contains(steps.changed.outputs.all_modified_files, '.yml') || contains(steps.changed.outputs.all_modified_files, '.yaml') |
| 37 | + run: yamllint . |
| 38 | + |
| 39 | + - name: markdownlint |
| 40 | + if: steps.changed_md.outputs.any_modified == 'true' |
| 41 | + run: npx markdownlint '**/*.md' --config .markdownlint.jsonc |
| 42 | + |
| 43 | + - name: actionlint |
| 44 | + run: actionlint |
| 45 | + |
| 46 | + - name: Build canonicals JSON |
| 47 | + run: node scripts/canonical-to-json.js |
| 48 | + |
| 49 | + - name: Validate front-matter |
| 50 | + run: node scripts/validate-frontmatter.js |
| 51 | + |
| 52 | + - name: Validate version |
| 53 | + run: node scripts/validate-version.js |
| 54 | + |
| 55 | + - name: Validate changelog |
| 56 | + run: node scripts/validate-changelog.js |
| 57 | + |
| 58 | + - name: Summary |
| 59 | + if: always() |
| 60 | + run: | |
| 61 | + cat <<'MD' >> $GITHUB_STEP_SUMMARY |
| 62 | + ### Quality Gates — develop |
| 63 | + - Lints & schema validators ran on changed files |
| 64 | + - Review failures above; fix and re-run |
| 65 | + - Owners: Workflows (primary), Docs (front-matter) |
| 66 | + MD |
0 commit comments