Skip to content

Commit 701a951

Browse files
committed
chore(gh): update linting workflow
Updates to linting workflow: - Limits workflow permissions. - Removes superfluous quotes. - Simplifies single branch reference. - References `go.mod` for the Go version. Signed-off-by: Ryan Johnson <[email protected]>
1 parent 060d9d0 commit 701a951

File tree

1 file changed

+17
-29
lines changed

1 file changed

+17
-29
lines changed

.github/workflows/govmomi-go-lint.yaml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
# Copyright (c) 2021 VMware, Inc. All Rights Reserved.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
151
name: Code Style
162

3+
permissions:
4+
contents: read
5+
176
on:
187
push:
19-
branches: [ 'main' ]
20-
8+
branches: main
219
pull_request:
22-
branches: [ 'main' ]
10+
branches: main
2311

2412
jobs:
2513
lint:
@@ -28,13 +16,13 @@ jobs:
2816
timeout-minutes: 10
2917

3018
steps:
31-
- name: Check out code
32-
uses: actions/checkout@v4
19+
- name: Check Repository
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3321

34-
- name: Set up Go
35-
uses: actions/setup-go@v5
22+
- name: Setup Go
23+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
3624
with:
37-
go-version: 1.22
25+
go-version-file: go.mod
3826
id: go
3927

4028
- name: Go Lint
@@ -52,16 +40,16 @@ jobs:
5240
# Map between extension and human-readable name.
5341
include:
5442
- extension: go
55-
language: Go
43+
language: go
5644

5745
steps:
58-
- name: Check out code
59-
uses: actions/checkout@v4
46+
- name: Check Repository
47+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6048

61-
- name: Set up Go
62-
uses: actions/setup-go@v5
49+
- name: Setup Go
50+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
6351
with:
64-
go-version: 1.22
52+
go-version-file: go.mod
6553
id: go
6654

6755
- name: Install Tools
@@ -80,7 +68,7 @@ jobs:
8068
echo "${TEMP_PATH}" >> "$GITHUB_PATH"
8169
8270
- id: boilerplate_txt
83-
uses: andstor/file-existence-action@v3
71+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
8472
with:
8573
files: ./hack/boilerplate/boilerplate.${{ matrix.extension }}.txt
8674

0 commit comments

Comments
 (0)