Skip to content

Commit

Permalink
add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sunhailin-Leo committed Dec 26, 2024
1 parent 73fef23 commit f0ae1a5
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/" # Location of package manifests
labels:
- "🤖 Dependencies"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
labels:
- "🤖 Dependencies"
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint Check
on:
push:
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: read
checks: write

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
- run: go version
#- run: diff -u <(echo -n) <(gofmt -d .)
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
args: --enable=nolintlint,gochecknoinits,bodyclose,gocritic --verbose
21 changes: 21 additions & 0 deletions .github/workflows/sercurity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Security Check
on:
push:
branches:
- main
pull_request:
jobs:
test:
strategy:
matrix:
go-version: [1.22.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: securego/gosec@v2.21.4
with:
args: '-exclude=G103,G104,G304,G402 ./...'
30 changes: 30 additions & 0 deletions .github/workflows/vulncheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Vulnerability Check
on:
push:
branches:
- main
paths:
- '**'
- '!**.md'
pull_request:
paths:
- '**'
- '!**.md'
jobs:
Security:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
check-latest: true
- name: Fetch Repository
uses: actions/checkout@v4
- name: Install Govulncheck
run: |
export GO111MODULE=on
export PATH=${PATH}:`go env GOPATH`/bin
go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run Govulncheck
run: "cd test && `go env GOPATH`/bin/govulncheck ./..."

0 comments on commit f0ae1a5

Please sign in to comment.