Skip to content

Commit e0bc8cd

Browse files
author
David Collom
authored
Resolve CodeQL "Issues" (#404)
1 parent be8c268 commit e0bc8cd

6 files changed

Lines changed: 22 additions & 10 deletions

File tree

.github/workflows/build-test.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ concurrency:
88
group: ${{ github.workflow }}-${{ github.ref }}
99
cancel-in-progress: true
1010

11+
# Setting some default permissions for all jobs
12+
permissions:
13+
contents: read
14+
security-events: read
15+
pull-requests: read
16+
checks: write
17+
1118
jobs:
1219
lint:
13-
permissions:
14-
contents: read # for actions/checkout to fetch code
15-
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
16-
checks: write # for golangci/golangci-lint-action to annotate Pull Requests
1720
name: Lint Go code
1821
runs-on: ubuntu-latest
1922
steps:
@@ -35,6 +38,8 @@ jobs:
3538
code-scan:
3639
name: Code Scan
3740
runs-on: ubuntu-latest
41+
permissions:
42+
security-events: write
3843
steps:
3944
- name: Checkout code
4045
uses: actions/checkout@v5
@@ -58,6 +63,8 @@ jobs:
5863
govulncheck:
5964
runs-on: ubuntu-latest
6065
name: Run govulncheck
66+
permissions:
67+
security-events: write
6168
steps:
6269
# We only need to checkout as govuln does the go setup...
6370
- name: Checkout code

.github/workflows/helm-test.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
1212
cancel-in-progress: true
1313

14+
permissions:
15+
contents: read
16+
pull-requests: read
17+
checks: write
18+
1419
jobs:
1520
lint:
16-
permissions:
17-
contents: read # for actions/checkout to fetch code
18-
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
1921
name: Lint Helm Chart
2022
runs-on: ubuntu-latest
2123
steps:

.github/workflows/release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
1212
cancel-in-progress: true
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
release-name:
1619
name: Generate a clean release name from the branch/tag

pkg/client/docker/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
var (
9-
dockerReg = regexp.MustCompile(`(^(.*\.)?docker.com$)|(^(.*\.)?docker.io$)`)
9+
dockerReg = regexp.MustCompile(`(^(.*\.)?docker\.com$)|(^(.*\.)?docker\.io$)`)
1010
)
1111

1212
func (c *Client) IsHost(host string) bool {

pkg/client/gcr/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
var (
9-
reg = regexp.MustCompile(`(^(.*\.)?gcr.io$|^(.*\.)?k8s.io$|^(.+)-docker.pkg.dev$)`)
9+
reg = regexp.MustCompile(`(^(.*\.)?gcr\.io$|^(.*\.)?k8s\.io$|^(.+)-docker\.pkg\.dev$)`)
1010
)
1111

1212
func (c *Client) IsHost(host string) bool {

pkg/client/quay/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
var (
9-
reg = regexp.MustCompile(`(^(.*\.)?quay.io$)`)
9+
reg = regexp.MustCompile(`(^(.*\.)?quay\.io$)`)
1010
)
1111

1212
func (c *Client) IsHost(host string) bool {

0 commit comments

Comments
 (0)