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
44 changes: 44 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# .codecov.yml

codecov:
require_ci_to_pass: true
notify:
wait_for_ci: true

coverage:
precision: 2
round: down
range: "70...100"

status:
project:
default:
target: 70%
threshold: 5%
base: auto
patch:
default:
target: 70%
threshold: 5%

ignore:
- "**/*_test.go"
- "**/testdata/**"
- "build/**"
- "_assets/**"

flags:
windows:
paths:
- "."
carryforward: true

comment:
layout: "header, diff, flags, files, footer"
behavior: default
require_changes: false
require_base: false
require_head: true

github_checks:
annotations: true
36 changes: 34 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,39 @@ updates:
- package-ecosystem: "go"
directory: "/" # Location of go.mod file
schedule:
interval: "weekly" # Options: "daily", "weekly", "monthly"
interval: "weekly" # Check for updates weekly
day: "monday"
time: "06:00"
timezone: "UTC"
commit-message:
prefix: "deps" # Default commit message prefix ("deps")
prefix: "deps" # Commit message prefix
include: "scope"
versioning-strategy: "increase" # Options: "increase", "lockfile-only", "auto"
reviewers:
- "nett00n"
assignees:
- "nett00n"
labels:
- "dependencies"
- "go"
open-pull-requests-limit: 5
rebase-strategy: "auto"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "UTC"
commit-message:
prefix: "ci"
include: "scope"
reviewers:
- "nett00n"
assignees:
- "nett00n"
labels:
- "dependencies"
- "github-actions"
open-pull-requests-limit: 3
50 changes: 48 additions & 2 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ on:
types: [published]

jobs:
test:
name: Run Tests Before Build
uses: ./.github/workflows/test.yml
secrets: inherit

build:
name: Build Release Artifacts
runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout code
Expand All @@ -33,7 +40,10 @@ jobs:
${{ runner.os }}-go-

- name: Install dependencies
run: go mod tidy
run: go mod download

- name: Verify dependencies
run: go mod verify

- name: Set version from git tag
run: echo "VERSION=$(git describe --tags --always --dirty)" >> $GITHUB_ENV
Expand All @@ -46,6 +56,23 @@ jobs:
env:
VERSION: ${{ env.VERSION }}

- name: Verify build artifacts
run: |
ls -la ./build/
if [ ! -f "./build/WinGoDarkTray-x64.exe" ]; then
echo "Error: x64 executable not found"
exit 1
fi
if [ ! -f "./build/WinGoDarkTray-x32.exe" ]; then
echo "Error: x32 executable not found"
exit 1
fi
if [ ! -f "./build/WinGoDarkTray-arm64.exe" ]; then
echo "Error: ARM64 executable not found"
exit 1
fi
echo "All build artifacts verified successfully"

- name: Upload Windows Executables to Release
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
Expand All @@ -60,10 +87,29 @@ jobs:
updateOnlyUnreleased: true

- name: VirusTotal Scan
if: env.VT_API_KEY != ''
uses: crazy-max/ghaction-virustotal@v4
env:
VT_API_KEY: ${{ secrets.VT_API_KEY }}
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
vt_api_key: ${{ env.VT_API_KEY }}
files: |
./build/WinGoDarkTray-x32.exe
./build/WinGoDarkTray-x64.exe
./build/WinGoDarkTray-arm64.exe

- name: Generate checksums
run: |
cd ./build/
sha256sum *.exe > checksums.txt
cat checksums.txt

- name: Upload checksums to release
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
artifacts: './build/checksums.txt'
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
69 changes: 69 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# dependency-review.yml

name: Dependency Review

on:
pull_request:
branches: [ main ]

permissions:
contents: read
pull-requests: write

jobs:
dependency-review:
name: Review Dependencies
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Dependency Review
uses: actions/dependency-review-action@v4
with:
comment-summary-in-pr: always
fail-on-severity: moderate
fail-on-scopes: runtime
base-ref: ${{ github.event.pull_request.base.sha }}
head-ref: ${{ github.event.pull_request.head.sha }}

license-check:
name: License Compatibility Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Install go-licenses
run: go install github.com/google/go-licenses@latest

- name: Check licenses
run: |
echo "Checking licenses for all dependencies..."
go-licenses report ./... --template licenses.tpl > licenses-report.txt || true

# Check for incompatible licenses (add more as needed)
INCOMPATIBLE_LICENSES=("GPL-3.0" "AGPL-3.0" "LGPL-3.0")

for license in "${INCOMPATIBLE_LICENSES[@]}"; do
if grep -q "$license" licenses-report.txt; then
echo "WARNING: Found potentially incompatible license: $license"
grep "$license" licenses-report.txt
fi
done

echo "License check completed. See licenses-report.txt for details."

- name: Upload license report
uses: actions/upload-artifact@v4
with:
name: license-report
path: licenses-report.txt
retention-days: 30
120 changes: 120 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# security.yml

name: Security Scan

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
schedule:
# Run security scan weekly on Sundays at 2 AM UTC
- cron: '0 2 * * 0'

# Security scanning with reliable, built-in tools:
# - govulncheck: Official Go vulnerability database scanner
# - CodeQL: GitHub's semantic code analysis
# - staticcheck: Advanced static analysis (honnef.co/go/tools)
# - go vet: Built-in Go static analyzer

jobs:
govulncheck:
name: Go Vulnerability Check
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

Comment on lines +29 to +33

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

🧩 Analysis chain

Don’t hardcode Go 1.25; align with go.mod.

Use setup-go’s go-version-file to follow the repo’s declared version; avoids breakage if 1.25 isn’t available.

Apply:

-    - name: Set up Go
-      uses: actions/setup-go@v5
-      with:
-        go-version: '1.25'
+    - name: Set up Go
+      uses: actions/setup-go@v5
+      with:
+        go-version-file: 'go.mod'

Also applies to: 74-78, 97-101


🏁 Script executed:

#!/bin/bash
# Show declared Go toolchain in go.mod
rg -n '^go\s+\d+\.\d+' go.mod -n || cat go.mod

Length of output: 11


🌐 Web query:

Is Go 1.25 released and supported by actions/setup-go@v5? What is the latest stable Go version?

💡 Result:

Yes — Go 1.25 is released (go1.25.0 released August 12, 2025) and the official Go site shows the 1.25 release. [1]

actions/setup-go@v5 can install any Go release listed in the actions/go-versions manifest (and will download versions JIT if not in the runner image), so you can use setup-go@v5 with go-version: '1.25' (or 'stable') to get Go 1.25. [2][3]

Sources:

  • Go 1.25 release announcement and release notes. [1]
  • actions/setup-go README (v5) showing go-version usage and that it pulls versions from actions/go-versions. [2]
  • actions/go-versions repository (versions-manifest used by setup-go). [3]

Align workflow Go version to go.mod (don't hardcode 1.25).

go.mod declares "go 1.23.1" while the workflow hardcodes 1.25 — replace the hardcoded go-version with setup-go's go-version-file to follow go.mod and avoid CI/toolchain drift.

Applies to: .github/workflows/security.yml — lines 29-33, 74-78, 97-101.

-    - name: Set up Go
-      uses: actions/setup-go@v5
-      with:
-        go-version: '1.25'
+    - name: Set up Go
+      uses: actions/setup-go@v5
+      with:
+        go-version-file: 'go.mod'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
🤖 Prompt for AI Agents
In .github/workflows/security.yml around lines 29-33, 74-78 and 97-101, the
workflow currently hardcodes go-version: '1.25'; replace that with the setup-go
input that reads the Go version from the repository (use setup-go's
go-version-file pointing to go.mod) so the CI uses the go version declared in
go.mod; update each occurrence to use go-version-file: 'go.mod' and remove the
hardcoded go-version value.

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: Run govulncheck
run: govulncheck ./...

codeql:
name: CodeQL Analysis
runs-on: windows-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:go"

dependency-scan:
name: Dependency Vulnerability Scan
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Install dependencies
run: go mod download

- name: Run go mod audit (built-in vulnerability check)
run: |
echo "Checking for known vulnerabilities in dependencies..."
go list -json -deps ./... | findstr "Module" || echo "Dependency scan completed"
echo "Note: Using govulncheck for comprehensive vulnerability analysis"
continue-on-error: true

static-analysis:
name: Static Security Analysis
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Run staticcheck security analysis
run: staticcheck -f sarif ./... > staticcheck-results.sarif
continue-on-error: true

- name: Upload staticcheck SARIF file
if: always() && hashFiles('staticcheck-results.sarif') != ''
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: staticcheck-results.sarif
category: staticcheck

- name: Run go vet security analysis
run: |
echo "Running go vet for security analysis..."
go vet ./... || echo "go vet completed with findings"
continue-on-error: true
Loading
Loading