Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,28 @@ on:

jobs:
secret-scan:
permissions:
contents: read # Needed for GITHUB_TOKEN to access repo
security-events: write # Required for Gitleaks to report findings
actions: read # For GitHub Actions API access
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for Gitleaks to work properly
- name: Gitleaks Secret Scan
uses: gitleaks/gitleaks-action@v2
with:
args: detect --redact --no-banner --exit-code 1
config-path: .gitleaks.toml

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
Expand All @@ -32,18 +40,29 @@ jobs:
version: latest
args: --timeout=3m

build-test:
test:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Get dependencies
run: go mod tidy
- name: Vet
run: go vet ./...
- name: Build
run: go build ./...
- name: Test (race + cover)
run: go test ./... -race -cover
run: go build -v ./...
- name: Test with coverage
run: |
mkdir -p coverage
go test -race -coverprofile=coverage/coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/coverage.txt
fail_ci_if_error: false
27 changes: 27 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
title = "DocLoom Secret Scanning"
version = "9.14.3"

[allowlist]
description = "Allow common false positives"
paths = [
"^docs/",
"^examples/",
"^README\\.md$",
"^CHANGELOG\\.md$",
"^cmd/",
"^internal/",
"^test/",
"_test\\.go$",
"fixtures/",
"testdata/",
"^vendor/"
]
regexes = [
"127\\.0\\.0\\.1",
"localhost",
"token",
"internal",
"secret",
"password",
"key"
]
Loading