Skip to content

Commit 7a2500c

Browse files
committed
Fix golang actions
- add manual scanning of github keys, it is required since webfactory/ssh-agen `v0.8.0` S. https://github.com/webfactory/ssh-agent/releases - remove hard-coded golang version, always build with the one from `go.mod`. Note: it requires the checkout to be done *before* setting up the go action, otherwise the version cannot be determined, obviously - bump golangci-lint version to `v1.53.3`. `v1.50.*` is not compatible with golang `1.20`, s. golangci/golangci-lint#3420
1 parent 58fe259 commit 7a2500c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
name: lint
1111
runs-on: self-hosted
1212
steps:
13-
- uses: actions/setup-go@v3
14-
with:
15-
go-version: '1.19'
1613
- uses: actions/checkout@v3
1714
with:
1815
ref: ${{ github.event.pull_request.head.sha }}
16+
- uses: actions/setup-go@v3
17+
with:
18+
go-version-file: go.mod
1919
- run: ./hack/setup-git-redirect.sh
2020
env:
2121
GITHUB_PAT: ${{ secrets.BOT_PAT }}
2222
- name: golangci-lint
2323
uses: golangci/golangci-lint-action@v3
2424
with:
25-
version: v1.50.0
25+
version: v1.53.3

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ jobs:
1717
ref: ${{ github.event.pull_request.head.sha }}
1818
- uses: actions/setup-go@v3
1919
with:
20-
go-version: '1.19'
20+
go-version-file: go.mod
21+
- run: |
22+
mkdir -p ~/.ssh
23+
for key in rsa ecdsa ed25519; do
24+
ssh-keyscan -t $key github.com 2>/dev/null >> ~/.ssh/known_hosts
25+
done
2126
- uses: webfactory/[email protected]
2227
with:
2328
ssh-private-key: ${{ secrets.BOT_PRIVATE_KEY }}

0 commit comments

Comments
 (0)