Skip to content

chore(deps): update golangci/golangci-lint-action digest to 2226d7c #85

chore(deps): update golangci/golangci-lint-action digest to 2226d7c

chore(deps): update golangci/golangci-lint-action digest to 2226d7c #85

Workflow file for this run

name: Continious integration
on:
pull_request:
branches:
- main
jobs:
tests:
name: Run tests and upload results
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.21", "1.22"]
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# This is currently workaround for checking if gofiles have changed,
# Because paths filter doesn't work with required checks
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@dcc7a0cba800f454d79fff4b993e8c3555bcc0a8 # v45
with:
files: |
cmd/**
internal/**
.golangci.yml
go.mod
go.sum
- name: Setup Go
if: steps.changed-files.outputs.any_modified == 'true'
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
with:
go-version: ${{ matrix.go-version }}
- name: golangci-lint
if: steps.changed-files.outputs.any_modified == 'true'
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6
with:
version: latest
args: --timeout=5m
- name: Install dependencies
if: steps.changed-files.outputs.any_modified == 'true'
run: go mod download
- name: Test with Go
if: steps.changed-files.outputs.any_modified == 'true'
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage reports to Codecov
if: steps.changed-files.outputs.any_modified == 'true'
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: cover.txt
slug: bl4ko/netbox-ssot
vulnerabilities:
name: Check for vulnerabilities
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@dcc7a0cba800f454d79fff4b993e8c3555bcc0a8 # v45
with:
files: |
cmd/**
internal/**
.golangci.yml
go.mod
go.sum
.dockerignore
Dockerfile
- name: Run Trivy vulnerability scanner
if: steps.changed-files.outputs.any_modified == 'true'
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'