From fbc9cc534a2287854abc8dbc97e2a06f79aa8b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20F=C3=9CHRMANN?= Date: Tue, 2 Aug 2022 23:54:50 +0200 Subject: [PATCH] ci: use super-linter instead of golangci-lint [super-linter](https://github.com/marketplace/actions/super-linter) is a big GitHub action to perform lint in a lot of languages. Use it to have Golang, Proto & YAML linting in this repo. --- .github/workflows/golangci-lint.yml | 20 ----------- .github/workflows/linter.yml | 53 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/golangci-lint.yml create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml deleted file mode 100644 index 6bbe683..0000000 --- a/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: golangci-lint -on: - push: - tags: - - v* - branches: - - main - pull_request: -permissions: - contents: read -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v3 - - uses: actions/checkout@v3 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 \ No newline at end of file diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..c8da9f1 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,53 @@ +--- +################################# +################################# +## Super Linter GitHub Actions ## +################################# +################################# +name: Lint Code Base + +# +# Documentation: +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions +# + +############################# +# Start the job on all push # +############################# +on: + push: + pull_request: + branches: [main] + +############### +# Set the Job # +############### +jobs: + build: + # Name the Job + name: Lint Code Base + # Set the agent to run on + runs-on: ubuntu-latest + + ################## + # Load all steps # + ################## + steps: + ########################## + # Checkout the code base # + ########################## + - name: Checkout Code + uses: actions/checkout@v3 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + ################################ + # Run Linter against code base # + ################################ + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}