From f228b06632c79b002baae4350395a99e795c1f37 Mon Sep 17 00:00:00 2001 From: Chris Banks Date: Mon, 8 Jul 2024 13:31:54 +0100 Subject: [PATCH] Replace our various lint actions with github/super-linter. This gets rid of a lot of ugly glue that we'd otherwise have to continue maintaining ourselves. --- .github/workflows/actionlint.yml | 12 ---------- .github/workflows/lint.yaml | 39 +++++++++++++++++++------------- 2 files changed, 23 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/actionlint.yml diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml deleted file mode 100644 index a6ab5db..0000000 --- a/.github/workflows/actionlint.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Lint GitHub Actions -on: - push: - paths: ['.github/workflows/**', '.github/actions/**', '.github/actionlint.yml'] -jobs: - actionlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - show-progress: false - - uses: alphagov/govuk-infrastructure/.github/actions/actionlint@main diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 5c031dc..954b590 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,23 +1,30 @@ -name: Run linters/fixers +--- +name: Lint on: [push] +permissions: {} jobs: - shellcheck: - name: Shellcheck + superlinter: runs-on: ubuntu-latest + permissions: + contents: read + packages: read + statuses: write steps: - uses: actions/checkout@v4 with: + fetch-depth: 0 show-progress: false - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0 - hadolint: - name: Hadolint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - show-progress: false - - uses: jbergstroem/hadolint-gh-action@eac45b98f6d761309202bd201205a8f8c988bfad # v1.11.0 - with: - dockerfile: '**/*Dockerfile' - error_level: '1' # Fail on warning or above. + - uses: github/super-linter@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_BASH: true + VALIDATE_BASH_EXEC: true + VALIDATE_DOCKERFILE_HADOLINT: true + VALIDATE_EDITORCONFIG: true + VALIDATE_ENV: true + VALIDATE_GITHUB_ACTIONS: true + VALIDATE_JSON: true + VALIDATE_MARKDOWN: true + VALIDATE_SHELL_SHFMT: true + VALIDATE_YAML: true + YAML_ERROR_ON_WARNING: true