Skip to content

Commit

Permalink
chore: add yaml lint step for workflows, configs
Browse files Browse the repository at this point in the history
  • Loading branch information
sgammon committed Aug 13, 2023
1 parent a3fe410 commit fcb88d7
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ jobs:

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2.21.3
continue-on-error: true
with:
category: "/language:${{matrix.language}}"
110 changes: 110 additions & 0 deletions .github/workflows/check.lint-yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: "Lint: YAML"

Check warning on line 1 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

1:1 [document-start] missing document start "---"

concurrency:
group: lint-yaml-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

Check failure on line 6 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

6:1 [trailing-spaces] trailing spaces
on:

Check warning on line 7 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

7:1 [truthy] truthy value should be one of [false, true]
## Check YAML on merge queue insertion
merge_group: {}

## Check on release
release:
types: [created]

## Check on push to `main` if modified
push:
branches:
- main
paths:
- ".github/workflows/*.yaml"
- ".github/workflows/*.yml"
- ".bazelci/presubmit.yml"
- ".bcr/*.yml"

## Check each PR change against `main`
pull_request:
paths:
- ".github/workflows/*.yaml"
- ".github/workflows/*.yml"
- ".bazelci/presubmit.yml"
- ".bcr/*.yml"

permissions:
contents: read

Check failure on line 34 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

34:3 [indentation] wrong indentation: expected 4 but found 2

jobs:
## Task: Lint workflows in this respository with YAMLLint
lint-workflows-yaml:
name: "Workflows"
runs-on: ${{ vars.RUNNER || 'ubuntu-latest' }}
permissions:
contents: "read"
id-token: "write"
checks: "write"
pull-requests: "read"
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0

Check warning on line 48 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

48:90 [comments] too few spaces before comment

Check failure on line 48 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

48:81 [line-length] line too long (97 > 80 characters)
with:
egress-policy: audit

Check failure on line 50 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

50:17 [indentation] wrong indentation: expected 18 but found 16
- name: "Setup: Checkout"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

Check warning on line 52 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

52:79 [comments] too few spaces before comment

Check failure on line 52 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

52:81 [line-length] line too long (86 > 80 characters)
- name: 'Lint: YAML'
uses: karancode/yamllint-github-action@master
with:
yamllint_file_or_dir: '.github/workflows'

Check failure on line 56 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

56:17 [indentation] wrong indentation: expected 18 but found 16
yamllint_strict: false
yamllint_comment: true
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Check failure on line 60 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

60:17 [indentation] wrong indentation: expected 18 but found 16

## Task: Lint Bazel Central Registry config files
lint-bcr-yaml:
name: "BCR"
runs-on: ${{ vars.RUNNER || 'ubuntu-latest' }}
permissions:
contents: "read"
id-token: "write"
checks: "write"
pull-requests: "read"
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0

Check warning on line 73 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

73:90 [comments] too few spaces before comment

Check failure on line 73 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

73:81 [line-length] line too long (97 > 80 characters)
with:
egress-policy: audit

Check failure on line 75 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

75:17 [indentation] wrong indentation: expected 18 but found 16
- name: "Setup: Checkout"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

Check warning on line 77 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

77:79 [comments] too few spaces before comment

Check failure on line 77 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

77:81 [line-length] line too long (86 > 80 characters)
- name: 'Lint: YAML'
uses: karancode/yamllint-github-action@master
with:
yamllint_file_or_dir: '.bcr'
yamllint_strict: false
yamllint_comment: true
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

## Task: Lint Bazel CI config files
lint-bazelci-yaml:
name: "BCR"
runs-on: ${{ vars.RUNNER || 'ubuntu-latest' }}
permissions:
contents: "read"
id-token: "write"
checks: "write"
pull-requests: "read"
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0

Check warning on line 98 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

98:90 [comments] too few spaces before comment
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

Check warning on line 102 in .github/workflows/check.lint-yaml.yml

View workflow job for this annotation

GitHub Actions / Workflows

102:79 [comments] too few spaces before comment
- name: 'Lint: YAML'
uses: karancode/yamllint-github-action@master
with:
yamllint_file_or_dir: '.bazelci'
yamllint_strict: false
yamllint_comment: true
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.

0 comments on commit fcb88d7

Please sign in to comment.