Skip to content

Commit

Permalink
Merge pull request #438 from okp4/ci/codeql
Browse files Browse the repository at this point in the history
ci(workflow): add codeql analysis job on go source
  • Loading branch information
ccamel authored Aug 22, 2023
2 parents 70fce53 + 37d9167 commit 0ca913d
Showing 1 changed file with 45 additions and 6 deletions.
51 changes: 45 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
- name: Lint regular markdown files
uses: avto-dev/[email protected]
with:
args: '**/*.md'
ignore: 'CHANGELOG.md docs/**/*.md'
args: "**/*.md"
ignore: "CHANGELOG.md docs/**/*.md"

- name: Lint generated markdown files
uses: avto-dev/[email protected]
with:
args: 'docs/**/*.md'
config: 'docs/.markdownlint.yaml'
args: "docs/**/*.md"
config: "docs/.markdownlint.yaml"

lint-yaml:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
uses: actions/[email protected]
if: steps.changed-go-files.outputs.any_changed == 'true'
with:
go-version: '1.20'
go-version: "1.20"
cache: false

- name: Lint go code (golangci-lint)
Expand All @@ -118,6 +118,45 @@ jobs:
fi
echo "✅ Code is gofumpt!"
analyze-go:
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Find changed go files
id: changed-go-files
uses: tj-actions/[email protected]
with:
files: |
**/*.go
go.mod
go.sum
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: "1.20"
cache: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: "go"

- name: Autobuild project
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

lint-dockerfile:
runs-on: ubuntu-22.04
if: github.actor != 'dependabot[bot]'
Expand Down Expand Up @@ -159,7 +198,7 @@ jobs:
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: '1.20'
go-version: "1.20"

- name: Generate command documentation
run: |
Expand Down

0 comments on commit 0ca913d

Please sign in to comment.