Optimize Your CI/CD Pipeline
Get instant insights into your CI/CD performance and costs. Reduce build times by up to 45% and save on infrastructure costs.
name: 'Usage of golangci-lint-action GitHub Action'
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
golangci-lint-action
Official GitHub Action for golangci-lint from its authors
What is Go Lang Lint Action?
In our Go projects, ensuring code quality and adhering to style guidelines is crucial. The golangci-lint-action is the official GitHub Action provided by the authors of golangci-lint, designed to simplify the integration of code linting into our CI/CD pipelines. Here’s how you can utilize this action to automatically run golangci-lint and report issues from linters directly in your GitHub Actions workflows.
How to Configure Go Lint Action for Multiple Operating Systems
As our Go projects expand, ensuring compatibility across different operating systems becomes increasingly crucial. The golangci-lint-action
supports multi-OS testing, allowing us to run linters effectively across various environments. This guide will walk you through setting up the action to run on different operating systems using GitHub Actions.
name: golangci-lint
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
golangci:
strategy:
matrix:
go: ['1.22']
os: [ubuntu-latest, macos-latest, windows-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58