Skip to content

Commit f32156b

Browse files
committed
chore: update workflows
1 parent 200b05c commit f32156b

5 files changed

Lines changed: 51 additions & 66 deletions

File tree

.github/workflows/checks.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,42 @@ on:
55
branches:
66
- main
77
pull_request:
8-
permissions:
9-
contents: read
10-
pull-requests: read
8+
9+
permissions: {}
10+
1111
env:
1212
CGO_ENABLED: 0
13-
GOLANGCI_LINT_VERSION: v2.9.0
14-
SHELLCHECK_SCRIPTS: ./*.sh
13+
GOLANGCI_LINT_VERSION: v2.12
14+
1515
jobs:
1616
go-lint-checks:
1717
runs-on: ubuntu-latest
18+
permissions:
19+
checks: write # Allow write access to checks to allow annotation of code in the PR.
20+
contents: read
21+
pull-requests: read
1822
steps:
19-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
23+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2024
with:
2125
persist-credentials: false
2226
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
2327
with:
2428
go-version-file: go.mod
2529
- name: Run GolangCI-Lint
26-
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
30+
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9
2731
with:
2832
version: ${{ env.GOLANGCI_LINT_VERSION }}
2933
go-mod-checks:
3034
runs-on: ubuntu-latest
3135
steps:
32-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
36+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3337
with:
3438
persist-credentials: false
3539
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
3640
with:
3741
go-version-file: go.mod
3842
- name: Check if go.mod is tidy
39-
run: |
40-
go mod tidy
41-
git diff --exit-code go.mod go.sum ||
42-
(echo "::error::go.mod and go.sum need to be tidy" && exit 1)
43+
run: go mod tidy --diff
4344
- name: Check if vendor directory is up to date
4445
run: |
4546
go mod vendor

.github/workflows/go-cross.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
branches:
55
- main
66
pull_request:
7-
permissions:
8-
contents: read
9-
pull-requests: read
7+
8+
permissions: {}
9+
1010
jobs:
1111
cross:
1212
name: Build on ${{ matrix.os }} with Go ${{ matrix.go-version }}
@@ -25,7 +25,7 @@ jobs:
2525
- windows-latest
2626
steps:
2727
- name: Checkout code
28-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
28+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2929
with:
3030
persist-credentials: false
3131
- name: Set up Go

.github/workflows/release.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- "v[0-9]+.[0-9]+.[0-9]+"
77
permissions:
88
contents: read
9+
packages: write # Allow docker/build-push-action to publish to GitHub Container Registry
910
env:
1011
DOCKER_PLATFORMS: linux/amd64, linux/arm64, windows/amd64
1112
DOCKER_IMAGE_BASENAME: ghcr.io/${{ github.repository_owner }}
@@ -31,7 +32,7 @@ jobs:
3132
- linux
3233
- windows
3334
steps:
34-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
35+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3536
with:
3637
persist-credentials: false
3738
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
@@ -50,7 +51,7 @@ jobs:
5051
- name: Display ${{ matrix.app }} artifacts
5152
run: tree /tmp/dist
5253
- name: Store ${{ matrix.app }} artifacts
53-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
54+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
5455
with:
5556
name: ${{ matrix.app }}-${{ matrix.go-os }}-${{ matrix.go-arch }}
5657
path: /tmp/dist
@@ -61,19 +62,16 @@ jobs:
6162
strategy:
6263
matrix:
6364
include:
64-
- app: pebble
65-
expose_ports: "14000 15000"
66-
- app: pebble-challtestsrv
67-
expose_ports: "5001 5002 5003 8053 8055 8443"
68-
permissions:
69-
contents: read
70-
packages: write # Allow docker/build-push-action to publish to GitHub Container Registry
65+
- app: pebble
66+
expose_ports: "14000 15000"
67+
- app: pebble-challtestsrv
68+
expose_ports: "5001 5002 5003 8053 8055 8443"
7169
steps:
72-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
70+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
7371
with:
7472
persist-credentials: false
7573
- name: Download ${{ matrix.app }} artifacts
76-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
74+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
7775
with:
7876
merge-multiple: true
7977
path: /tmp/dist
@@ -82,7 +80,7 @@ jobs:
8280
run: tree /tmp/dist
8381
- name: Docker meta
8482
id: meta
85-
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
83+
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0
8684
with:
8785
images: ${{ env.DOCKER_IMAGE_BASENAME }}/${{ matrix.app }}
8886
# generate Docker tags based on the following events/attributes
@@ -93,9 +91,9 @@ jobs:
9391
type=sha
9492
type=raw,value=latest
9593
- name: Set up QEMU
96-
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
94+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
9795
- name: Set up Docker Buildx
98-
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
96+
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
9997
- name: Login to GitHub Container Registry
10098
run: printenv GITHUB_TOKEN | docker login -u "$GITHUB_ACTOR" --password-stdin ghcr.io
10199
env:
@@ -129,9 +127,7 @@ jobs:
129127
env:
130128
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131129
- name: Display pebble version in container image
132-
env:
133-
DOCKER_IMAGE_BASENAME: ${{ env.DOCKER_IMAGE_BASENAME }}
134-
run: docker run ${DOCKER_IMAGE_BASENAME}/pebble:latest -version
130+
run: docker run ${{ env.DOCKER_IMAGE_BASENAME }}/pebble:latest -version
135131
create-release:
136132
needs:
137133
- go-build
@@ -140,7 +136,7 @@ jobs:
140136
runs-on: ubuntu-latest
141137
steps:
142138
- name: Download build artifacts
143-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
139+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
144140
- name: Display build artifacts
145141
run: tree .
146142
- name: Create release

.github/workflows/tests.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
branches:
55
- main
66
pull_request:
7-
permissions:
8-
contents: read
9-
pull-requests: read
7+
8+
permissions: {}
9+
1010
jobs:
1111
certbot-linux:
1212
name: Run Certbot tests on Linux
@@ -18,12 +18,12 @@ jobs:
1818
echo "127.0.0.1 elpmaxe.letsencrypt.org" | sudo tee -a /etc/hosts
1919
# https://github.com/marketplace/actions/checkout
2020
- name: Check out code
21-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
21+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2222
with:
2323
persist-credentials: false
2424
# https://github.com/marketplace/actions/setup-go-environment
2525
- name: Set up Go
26-
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
26+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
2727
with:
2828
go-version-file: go.mod
2929
- name: Install packages
@@ -44,11 +44,11 @@ jobs:
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Check out code
47-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
47+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4848
with:
4949
persist-credentials: false
5050
- name: Set up Go
51-
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
51+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
5252
with:
5353
go-version-file: go.mod
5454
- name: go install commands
@@ -67,14 +67,14 @@ jobs:
6767
name: Test lego with EAB
6868
runs-on: ubuntu-latest
6969
steps:
70-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
70+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
7171
with:
7272
persist-credentials: false
73-
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
73+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
7474
with:
75-
go-version-file: go.mod
75+
go-version: stable
7676
- name: Install lego cli
77-
run: go install github.com/go-acme/lego/v4/cmd/lego@latest
77+
run: go install github.com/go-acme/lego/v5@latest
7878
- name: go install commands
7979
run: go install -v ./cmd/...
8080
- name: launch pebble
@@ -83,27 +83,26 @@ jobs:
8383
pebble -config test/config/pebble-config-external-account-bindings.json &
8484
- run: |
8585
LEGO_CA_CERTIFICATES=./test/certs/pebble.minica.pem \
86-
lego --accept-tos \
86+
lego run \
87+
--accept-tos \
8788
--server=https://localhost:14000/dir \
88-
--email="pebble-test@example.letsencrypt.org" \
8989
--domains=example.letsencrypt.org \
9090
--eab \
91-
--kid kid-3 \
92-
--hmac=HjudV5qnbreN-n9WyFSH-t4HXuEx_XFen45zuxY-G1h6fr74V3cUM_dVlwQZBWmc \
93-
--http --http.port=:5002 \
94-
run
91+
--eab.kid kid-3 \
92+
--eab.hmac=HjudV5qnbreN-n9WyFSH-t4HXuEx_XFen45zuxY-G1h6fr74V3cUM_dVlwQZBWmc \
93+
--http --http.address=:5002
9594
go-linux:
9695
name: Run Go tests on Linux
9796
runs-on: ubuntu-latest
9897
steps:
9998
- name: Check out code
100-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
99+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
101100
with:
102101
persist-credentials: false
103102
# Run project unit tests (with the race detector enabled and atomic coverage profile collection)
104103
- name: unittests
105104
run: go test -v -race -covermode=atomic -coverprofile=profile.cov ./...
106105
# Upload collected coverage profile to goveralls
107-
- uses: shogo82148/actions-goveralls@9606dbc5ac5cf888a0e9ef901515c3cd516a2790 # v1.11.0
106+
- uses: shogo82148/actions-goveralls@9606dbc5ac5cf888a0e9ef901515c3cd516a2790 # v1
108107
with:
109108
path-to-profile: profile.cov

.golangci.yaml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ linters:
2121
- gocyclo
2222
- goheader
2323
- gomoddirectives
24-
- gomodguard
2524
- goprintffuncname
2625
- importas
2726
- inamedparam
@@ -51,12 +50,12 @@ linters:
5150
min-complexity: 25
5251
misspell:
5352
locale: US
53+
goconst:
54+
ignore-tests: true
5455
exclusions:
55-
generated: lax
5656
presets:
5757
- comments
5858
- common-false-positives
59-
- legacy
6059
- std-error-handling
6160
rules:
6261
- path: ca/ca.go
@@ -71,10 +70,6 @@ linters:
7170
text: string `Incorrect validation certificate for %s challenge. ` has \d occurrences, make it a constant
7271
- path: (.+)\.go$
7372
text: fmt.Sprintf can be replaced with string
74-
paths:
75-
- third_party$
76-
- builtin$
77-
- examples$
7873
issues:
7974
max-issues-per-linter: 0
8075
max-same-issues: 0
@@ -83,9 +78,3 @@ formatters:
8378
- gofmt
8479
- gofumpt
8580
- goimports
86-
exclusions:
87-
generated: lax
88-
paths:
89-
- third_party$
90-
- builtin$
91-
- examples$

0 commit comments

Comments
 (0)