Skip to content

[StepSecurity] Apply security best practices #217

[StepSecurity] Apply security best practices

[StepSecurity] Apply security best practices #217

Workflow file for this run

---
# Run this locally with act - https://github.com/nektos/act
# act -j lintYaml
name: Lint YAML
on: # yamllint disable-line rule:truthy
push:
branches: [master, main]
paths:
- "**.yml"
- "**.yaml"
- ".github/workflows/**.yml"
- ".github/workflows/**.yaml"
pull_request:
branches: [master, main]
paths:
- "**.yml"
- "**.yaml"
- ".github/workflows/**.yml"
- ".github/workflows/**.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Ref: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions:
contents: read
jobs:
lintYaml:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Check YAML files with linter
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
with:
# All files under base dir
file_or_dir: "."
config_data: |
extends: default
yaml-files:
- '*.yaml'
- '*.yml'
rules:
document-start:
level: warning
line-length:
level: warning
new-line-at-end-of-file:
level: warning
trailing-spaces:
level: warning