Skip to content

Commit 9acea60

Browse files
hyp3rdCopilotgithub-advanced-security[bot]
authored
chore(deps,tooling): Go 1.25.6, golangci-lint v2.8.0; lib updates (#27)
- Tooling: - .golangci.yaml: set Go to 1.25.6 - .pre-commit/golangci-lint-hook: GOLANGCI_LINT_VERSION v2.7.2 → v2.8.0 - .pre-commit/unit-test-hook: toolchain_version → 1.25.6 - .project-settings.env: GO_VERSION 1.25.6; GOLANGCI_LINT_VERSION v2.8.0; BUF_VERSION 1.63.0 - Makefile: align GO and golangci-lint versions - App deps: - go.mod/go.sum: logrus v1.9.3 → v1.9.4; golang.org/x/sys v0.39.0 → v0.40.0 No functional code changes; keeps tooling and dependencies on latest patch releases for consistency. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 6613e81 commit 9acea60

14 files changed

Lines changed: 97 additions & 71 deletions

.github/workflows/gitleaks.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: gitleaks
3+
permissions:
4+
contents: read
5+
on:
6+
pull_request:
7+
push:
8+
workflow_dispatch:
9+
schedule:
10+
# run once a day at 4 AM
11+
- cron: "0 4 * * *"
12+
jobs:
13+
scan:
14+
name: gitleaks
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
with:
19+
fetch-depth: 0
20+
- uses: gitleaks/gitleaks-action@v2
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/go.yml

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,55 @@
11
---
2-
# This workflow will build a golang project
3-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
4-
52
name: Go
3+
permissions:
4+
contents: read
65

76
on:
8-
push:
9-
branches: ["main"]
10-
pull_request:
11-
branches: ["main"]
7+
pull_request:
8+
push:
9+
branches: [main]
1210

1311
jobs:
14-
build:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v6
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
- name: Load project settings
17+
id: settings
18+
run: |
19+
set -a
20+
source .project-settings.env
21+
set +a
22+
echo "go_version=${GO_VERSION}" >> "$GITHUB_OUTPUT"
23+
echo "gci_prefix=${GCI_PREFIX:-github.com/hyp3rd/ewrap}" >> "$GITHUB_OUTPUT"
24+
echo "golangci_lint_version=${GOLANGCI_LINT_VERSION}" >> "$GITHUB_OUTPUT"
25+
echo "proto_enabled=${PROTO_ENABLED:-false}" >> "$GITHUB_OUTPUT"
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v6.1.0
29+
with:
30+
go-version: "${{ steps.settings.outputs.go_version }}"
31+
check-latest: true
32+
33+
- name: Cache Go modules
34+
uses: actions/cache@v5
35+
with:
36+
path: |
37+
~/go/pkg/mod
38+
~/.cache/go-build
39+
key: ${{ runner.os }}-go-${{ steps.settings.outputs.go_version }}-${{ hashFiles('**/go.sum') }}
40+
restore-keys: |
41+
${{ runner.os }}-go-${{ steps.settings.outputs.go_version }}-
42+
43+
- name: Modules download
44+
run: go mod download
1845

19-
- name: Set up Go
20-
uses: actions/setup-go@v6
21-
with:
22-
go-version: "1.25.5"
46+
- name: Tidy check
47+
run: |
48+
go mod tidy
49+
git diff --exit-code go.mod go.sum
2350
24-
- name: Build
25-
run: go build -v ./...
51+
- name: Verify
52+
run: go mod verify
2653

27-
- name: Test
28-
run: go test -v ./...
54+
- name: Build
55+
run: go build -v ./...

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ run:
4242
# Define the Go version limit.
4343
# Mainly related to generics support since go1.18.
4444
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17
45-
go: "1.25.5"
45+
go: "1.25.6"
4646

4747
linters:
4848
# Enable specific linter

.pre-commit-ci-config.yaml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
44
rev: v6.0.0
55
hooks:
6-
- id: check-json
7-
- id: pretty-format-json
8-
exclude: cspell.json
96
- id: end-of-file-fixer
107
- id: mixed-line-ending
118
- id: trailing-whitespace
@@ -16,20 +13,15 @@ repos:
1613
files: .*\.(yaml|yml)$
1714
exclude: mkdocs.yml
1815
args: [--allow-multiple-documents]
19-
- id: requirements-txt-fixer
2016
- repo: https://github.com/adrienverge/yamllint.git
21-
rev: v1.37.1
17+
rev: v1.38.0
2218
hooks:
2319
- id: yamllint
2420
files: \.(yaml|yml)$
2521
types: [file, yaml]
2622
entry: yamllint --strict -f parsable
27-
- repo: https://github.com/hadolint/hadolint
28-
rev: v2.14.0
29-
hooks:
30-
- id: hadolint-docker
3123
- repo: https://github.com/streetsidesoftware/cspell-cli
32-
rev: v9.3.3
24+
rev: v9.4.0
3325
hooks:
3426
# Spell check changed files
3527
- id: cspell
@@ -53,15 +45,3 @@ repos:
5345
entry: mdl
5446
language: ruby
5547
files: \.(md|mdown|markdown)$
56-
- repo: local
57-
hooks:
58-
- id: go-verify
59-
name: go-verify
60-
language: system
61-
entry: ./.pre-commit/go-mod-hook
62-
require_serial: true
63-
- id: gci
64-
name: gci
65-
language: system
66-
entry: ./.pre-commit/gci-hook
67-
require_serial: true

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: requirements-txt-fixer
2020
- id: no-commit-to-branch
2121
- repo: https://github.com/adrienverge/yamllint.git
22-
rev: v1.37.1
22+
rev: v1.38.0
2323
hooks:
2424
- id: yamllint
2525
files: \.(yaml|yml)$

.pre-commit/golangci-lint-hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if [[ -f "${ROOT_DIR}/.project-settings.env" ]]; then
2323
# shellcheck disable=SC1090
2424
source "${ROOT_DIR}/.project-settings.env"
2525
fi
26-
GOLANGCI_LINT_VERSION="${GOLANGCI_LINT_VERSION:-v2.7.2}"
26+
GOLANGCI_LINT_VERSION="${GOLANGCI_LINT_VERSION:-v2.8.0}"
2727

2828
# #######################################
2929
# Install dependencies to run the pre-commit hook

.pre-commit/unit-test-hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ hook() {
2121
local root_dir
2222
root_dir=$(git rev-parse --show-toplevel)
2323

24-
local toolchain_version="1.25.5"
24+
local toolchain_version="1.25.6"
2525
if [[ -f "${root_dir}/.project-settings.env" ]]; then
2626
# shellcheck disable=SC1090
2727
source "${root_dir}/.project-settings.env"

.project-settings.env

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
GOLANGCI_LINT_VERSION=v2.7.2
2-
BUF_VERSION=v1.61.0
3-
GO_VERSION=1.25.5
1+
GOLANGCI_LINT_VERSION=v2.8.0
2+
BUF_VERSION=v1.63.0
3+
GO_VERSION=1.25.6
44
GCI_PREFIX=github.com/hyp3rd/ewrap
55
PROTO_ENABLED=false

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include .project-settings.env
22

3-
GOLANGCI_LINT_VERSION ?= v2.7.2
4-
GO_VERSION ?= 1.25.5
3+
GOLANGCI_LINT_VERSION ?= v2.8.0
4+
GO_VERSION ?= 1.25.6
55
GCI_PREFIX ?= github.com/hyp3rd/ewrap
66
PROTO_ENABLED ?= true
77

format.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ import (
1313
// serialized to various formats like JSON and YAML.
1414
type ErrorOutput struct {
1515
// Message contains the main error message
16-
Message string `json:"message" yaml:"message"`
16+
Message string `json:"message" yaml:"message"`
1717
// Timestamp indicates when the error occurred
18-
Timestamp string `json:"timestamp" yaml:"timestamp"`
18+
Timestamp string `json:"timestamp" yaml:"timestamp"`
1919
// Type categorizes the error
20-
Type string `json:"type" yaml:"type"`
20+
Type string `json:"type" yaml:"type"`
2121
// Severity indicates the error's impact level
22-
Severity string `json:"severity" yaml:"severity"`
22+
Severity string `json:"severity" yaml:"severity"`
2323
// Stack contains the error stack trace
24-
Stack string `json:"stack" yaml:"stack"`
24+
Stack string `json:"stack" yaml:"stack"`
2525
// Cause contains the underlying error if any
26-
Cause *ErrorOutput `json:"cause,omitempty" yaml:"cause,omitempty"`
26+
Cause *ErrorOutput `json:"cause,omitempty" yaml:"cause,omitempty"`
2727
// Context contains additional error context
28-
Context map[string]any `json:"context,omitempty" yaml:"context,omitempty"`
28+
Context map[string]any `json:"context,omitempty" yaml:"context,omitempty"`
2929
// Metadata contains user-defined metadata
3030
Metadata map[string]any `json:"metadata,omitempty" yaml:"metadata,omitempty"`
3131
// Recovery provides guidance on resolving the error

0 commit comments

Comments
 (0)