Skip to content

Commit 41b719b

Browse files
authored
Merge pull request #595 from 1Password/scoot/fix/ci-node-version-bump
Update workflows to fix node 20 deprecation and update golangci-lint-action version and config
2 parents adb4239 + b2fd49c commit 41b719b

6 files changed

Lines changed: 48 additions & 43 deletions

File tree

.github/workflows/check-flake.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check Nix flake
22
on:
33
pull_request:
44
paths:
5-
- '**.nix'
5+
- "**.nix"
66
- flake.lock
77
push:
88
branches:
@@ -11,9 +11,9 @@ jobs:
1111
check-flake:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: DeterminateSystems/nix-installer-action@main
16-
- uses: DeterminateSystems/magic-nix-cache-action@main
14+
- uses: actions/checkout@v6
15+
- uses: DeterminateSystems/nix-installer-action@v22
16+
- uses: DeterminateSystems/magic-nix-cache-action@v13
1717
- name: Check Nix flake inputs
1818
uses: DeterminateSystems/flake-checker-action@v5
1919
with:

.github/workflows/test.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ name: Test and Validate
22
on:
33
push:
44
paths-ignore:
5-
- '**.md'
6-
- '.github/ISSUE_TEMPLATE/**'
5+
- "**.md"
6+
- ".github/ISSUE_TEMPLATE/**"
77
pull_request:
88
paths-ignore:
9-
- '**.md'
10-
- '.github/ISSUE_TEMPLATE/**'
9+
- "**.md"
10+
- ".github/ISSUE_TEMPLATE/**"
1111

1212
jobs:
1313
build:
1414
name: Test
1515
runs-on: ubuntu-latest
1616
steps:
17+
- name: Check out code into the Go module directory
18+
uses: actions/checkout@v6
19+
1720
- name: Set up Go 1.x
18-
uses: actions/setup-go@v3
21+
uses: actions/setup-go@v6
1922
with:
2023
go-version: ^1.18
2124

22-
- name: Check out code into the Go module directory
23-
uses: actions/checkout@v3
24-
2525
- name: Test
2626
run: make test
2727

@@ -31,17 +31,17 @@ jobs:
3131
name: Lint
3232
runs-on: ubuntu-latest
3333
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v6
36+
3437
- name: "Set up Go 1.x"
35-
uses: actions/setup-go@v3
38+
uses: actions/setup-go@v6
3639
with:
3740
go-version: 1.19
3841

39-
- name: Check out code
40-
uses: actions/checkout@v3
41-
42-
- name: Lint with golanci-lint
43-
uses: golangci/golangci-lint-action@v3
42+
- name: Lint with golangci-lint
43+
uses: golangci/golangci-lint-action@v9
4444
with:
4545
# version of golangci-lint to use
4646
# Version should stay in sync with version used for local linting (lint job in Makefile).
47-
version: v1.50.1
47+
version: v2.12.2

.github/workflows/update-flake-dependencies.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
name: Update flake dependencies
33
on:
44
schedule:
5-
- cron: '0 16 * * 5'
5+
- cron: "0 16 * * 5"
66
workflow_dispatch: # for allowing manual triggers of the workflow
77
jobs:
88
update-dependencies:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- uses: DeterminateSystems/nix-installer-action@main
13-
- uses: DeterminateSystems/magic-nix-cache-action@main
11+
- uses: actions/checkout@v6
12+
- uses: DeterminateSystems/nix-installer-action@v22
13+
- uses: DeterminateSystems/magic-nix-cache-action@v13
14+
with:
15+
use-flakehub: false
1416
- name: Update flake.lock and create signed commit with flake.lock changes
1517
env:
1618
GITHUB_TOKEN: ${{ secrets.OP_BOT_TOKEN }}
@@ -23,7 +25,7 @@ jobs:
2325
# if branch exists on remote already
2426
BRANCH_EXISTS=false
2527
if git checkout "$COMMIT_BRANCH" > /dev/null 2>&1; then
26-
# pull changes
28+
# pull changeshttps://github.com/1Password/shell-plugins/pull/595
2729
git pull
2830
BRANCH_EXISTS=true
2931
else

.golangci.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1+
version: "2"
12
linters:
2-
disable-all: true
3+
default: none
34
enable:
45
# Defaults:
5-
- errcheck
6-
- gosimple
76
- govet
87
- ineffassign
9-
- staticcheck
10-
- typecheck
118
- unused
129
# Extra:
1310
- asciicheck
1411
- bidichk
12+
disable:
13+
# Scott L: currently these produce errors that need to be fixed in a seprate PR
14+
- errcheck
1515
- depguard
16-
- goimports
17-
- gofmt
16+
- staticcheck
17+
18+
settings:
19+
depguard:
20+
rules:
21+
main:
22+
deny:
23+
- pkg: math/rand
24+
desc: "please use the safer crypto/rand"
1825

19-
linters-settings:
20-
depguard:
21-
list-type: blacklist
22-
include-go-root: false
23-
packages:
24-
- math/rand
25-
packages-with-error-message:
26-
- math/rand: "please use the safer crypto/rand"
26+
formatters:
27+
enable:
28+
- gofmt
29+
- goimports

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test:
4444

4545
lint:
4646
# Version used should stay in sync with version in CI (.github/workflows/test.yaml).
47-
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.50.1 golangci-lint run
47+
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v2.12.2 golangci-lint run
4848

4949
%/remove-local: beta-notice
5050
$(eval plugin := $(firstword $(subst /, ,$@)))

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)