Skip to content

Commit 7a62c5b

Browse files
Update Managed Files (#17)
* Update dep-review * Update go-makefile * Update go-dependabot * Update go-test * Remove old test wf --------- Co-authored-by: StartToaster <[email protected]>
1 parent 977eb21 commit 7a62c5b

File tree

4 files changed

+41
-10
lines changed

4 files changed

+41
-10
lines changed

.github/dependabot.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
1+
# This file is managed by the repo-content-updater project. Manual changes here will result in a PR to bring back
2+
# inline with the upstream template, unless you remove the go-dependabot managed file property from the repo
63
version: 2
74
updates:
85
- package-ecosystem: gomod
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Managed by repo-content-updater
2+
# Dependency Review Action
3+
#
4+
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
5+
#
6+
# Source repository: https://github.com/actions/dependency-review-action
7+
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
8+
name: "🚨 Dependency Review"
9+
on: [pull_request]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
dependency-review:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: "Checkout Repository"
19+
uses: actions/checkout@v4
20+
21+
- name: "Dependency Review"
22+
uses: actions/dependency-review-action@v4
23+
with:
24+
deny-licenses: AGPL-1.0-only, AGPL-1.0-or-later, AGPL-1.0-or-later, AGPL-3.0-or-later, GPL-1.0-only, GPL-1.0-or-later, GPL-2.0-only, GPL-2.0-or-later, GPL-3.0-only, GPL-3.0-or-later
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test/Lint/Fmt/Vet
1+
name: Go Test
22
on:
33
push:
44
branches:
@@ -9,9 +9,11 @@ jobs:
99
test:
1010
runs-on: ubuntu-latest
1111
container: golang:1
12-
env:
13-
GOFLAGS: "-buildvcs=false"
1412
steps:
13+
- name: Mark git directory safe
14+
uses: Chia-Network/actions/git-mark-workspace-safe@main
15+
1516
- uses: actions/checkout@v4
17+
1618
- name: Test
1719
run: make test

Makefile

+10-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ all: fmt lint vet build
2525
.PHONY: build
2626
build: $(BIN) ; $(info $(M) building executable…) @ ## Build program binary
2727
$Q CGO_ENABLED=0 $(GO) build \
28+
-ldflags "-X main.gitVersion=$$(git describe --tags) -X $(MODULE)/cmd.gitVersion=$$(git describe --tags) -X \"main.buildTime=$$(date -u '+%Y-%m-%d %H:%M:%S %Z')\" -X \"$(MODULE)/cmd.buildTime=$$(date -u '+%Y-%m-%d %H:%M:%S %Z')\"" \
2829
-tags release \
29-
-o $(BIN)/$(notdir $(basename $(MODULE)))$(binext) main.go
30+
-o $(BIN)/$(notdir $(basename $(MODULE)))$(binext)
3031
# Tools
3132

3233
$(BIN):
@@ -45,6 +46,9 @@ $(BIN)/staticcheck: PACKAGE=honnef.co/go/tools/cmd/staticcheck@latest
4546
ERRCHECK = $(BIN)/errcheck
4647
$(BIN)/errcheck: PACKAGE=github.com/kisielk/errcheck@latest
4748

49+
VULNCHECK = $(BIN)/govulncheck
50+
$(BIN)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck@latest
51+
4852
# Tests
4953

5054
TEST_TARGETS := test-default test-bench test-short test-verbose test-race
@@ -55,7 +59,7 @@ test-verbose: ARGS=-v ## Run tests in verbose mode
5559
test-race: ARGS=-race ## Run tests with race detector
5660
$(TEST_TARGETS): NAME=$(MAKECMDGOALS:test-%=%)
5761
$(TEST_TARGETS): test
58-
check test tests: fmt lint vet staticcheck errcheck; $(info $(M) running $(NAME:%=% )tests…) @ ## Run tests
62+
check test tests: fmt lint vet staticcheck errcheck vulncheck; $(info $(M) running $(NAME:%=% )tests…) @ ## Run tests
5963
$Q $(GO) test -timeout $(TIMEOUT)s $(ARGS) $(TESTPKGS)
6064

6165
.PHONY: lint
@@ -78,6 +82,10 @@ staticcheck: | $(STATICCHECK) ; $(info $(M) running staticcheck…) @
7882
errcheck: | $(ERRCHECK) ; $(info $(M) running errcheck…) @
7983
$Q $(ERRCHECK) $(PKGS)
8084

85+
.PHONY: vulncheck
86+
vulncheck: | $(VULNCHECK) ; $(info $(M) running vulncheck…) @
87+
$Q $(VULNCHECK) $(PKGS)
88+
8189
# Misc
8290

8391
.PHONY: clean

0 commit comments

Comments
 (0)