Skip to content

Latest commit

 

History

History
177 lines (127 loc) · 8.18 KB

File metadata and controls

177 lines (127 loc) · 8.18 KB

GitHub Reusable Workflow: Linter

Linter

Release License Stars PRs Welcome

Overview

Reusable workflow that performs linting on the codebase. Executes:

  • Super-Linter, with some opinionated defaults.
  • CodeQL to analyze the code.
  • Ratchet to check that GitHub Action versions are pinned.

Permissions

  • contents: read
  • statuses: write

Usage

name: Linter
on:
  push:
    branches:
      - main
permissions:
  contents: read
  statuses: write
jobs:
  linter:
    uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@b7dd413209df265bef8d7eb0efb117eaabc684c4 # 0.27.0
    secrets:
      # Token for marking the status of linter run in the Checks section.
      # See https://github.com/super-linter/super-linter#how-to-use.
      # Default GITHUB_TOKEN.
      github-token: ""
    with:
      # JSON array of runner(s) to use.
      # See https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job.
      #
      # Default: `["ubuntu-latest"]`
      runs-on: '["ubuntu-latest"]'

      # Environment variables in multilines format "key=value" to pass to the linter.
      # See https://github.com/super-linter/super-linter.
      linter-env: ""

      # JSON array of languages to analyze with CodeQL.
      # See https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/.
      # Leave empty to disable the check.
      #
      # Default: `["actions"]`
      codeql-languages: '["actions"]'

      # List of files or directories where GitHub Actions and workflows are located.
      # Supports glob patterns.
      # Leave empty to disable the check.
      #
      # Default: `./action.yml
      # ./.github/workflows/**/*.yml
      # ./actions/**/*.yml
      # `
      action-files: |
        ./action.yml
        ./.github/workflows/**/*.yml
        ./actions/**/*.yml

      # Run checks on all files, not just the changed ones.
      # Default: `${{ github.event_name != 'pull_request' }}`
      lint-all: false

Inputs

Workflow Call Inputs

Input Description Required Type Default
runs-on JSON array of runner(s) to use. false string ["ubuntu-latest"]
See https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job.
linter-env Environment variables in multilines format "key=value" to pass to the linter. false string -
See https://github.com/super-linter/super-linter.
codeql-languages JSON array of languages to analyze with CodeQL. false string ["actions"]
See https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/.
Leave empty to disable the check.
action-files List of files or directories where GitHub Actions and workflows are located. false string
./action.yml
./.github/workflows/**/*.yml
./actions/**/*.yml
Supports glob patterns.
Leave empty to disable the check.
lint-all Run checks on all files, not just the changed ones. false boolean $\{\{ github.event_name != 'pull_request' }}

Secrets

Secret Description Required
github-token Token for marking the status of linter run in the Checks section. false
See https://github.com/super-linter/super-linter#how-to-use.
Default GITHUB_TOKEN.

Contributing

Contributions are welcome! Please see the contributing guidelines for more details.

License

This project is licensed under the MIT License.

SPDX-License-Identifier: MIT

Copyright © 2025 hoverkraft-tech

For more details, see the license.


This documentation was automatically generated by CI Dokumentor.