mirror of
https://github.com/awsdocs/aws-doc-sdk-examples.git
synced 2026-03-26 06:22:18 +00:00
* Scope down GitHub token permissions for writeme.yml, yaml-lint.yml, lint-php.yml, lint-ruby.yml, lint-kotlin.yml, and lint-javascript.yml
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: Lint Yaml
|
|
|
|
on: # yamllint disable-line rule:truthy
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
yamllint:
|
|
name: Lint Yaml
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout files
|
|
uses: actions/checkout@v4
|
|
with:
|
|
sparse-checkout: |
|
|
.github
|
|
.doc_gen/metadata
|
|
.tools
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
|
|
with:
|
|
files: "**/*.{yml,yaml}"
|
|
- name: Setup Python
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: 3.11
|
|
- name: Install dependencies
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
run: >-
|
|
python3 -m pip install -r .tools/base_requirements.txt
|
|
- name: Lint YAML files
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
run: >-
|
|
yamllint --format standard -c .tools/validation/.yamllint.yaml .
|