Skip to content

Commit 484e5ad

Browse files
committed
Only check one level of children
1 parent 2550c3f commit 484e5ad

File tree

3 files changed

+37
-39
lines changed

3 files changed

+37
-39
lines changed

.github/workflows/helm-test.yaml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,39 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
setup:
16-
name: "Checkout and Setup"
15+
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
19+
name: Lint Helm Chart
1720
runs-on: ubuntu-latest
1821
steps:
1922
- name: Checkout code
2023
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
24+
2125
- name: Setup Golang
2226
uses: actions/setup-go@v5
2327
with:
2428
go-version-file: go.mod
29+
2530
- uses: azure/setup-helm@v4
26-
with:
27-
token: ${{ github.token }}
2831

29-
lint:
30-
needs:
31-
- setup
32-
permissions:
33-
contents: read # for actions/checkout to fetch code
34-
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
35-
name: Lint Helm Chart
36-
runs-on: ubuntu-latest
37-
steps:
3832
- run: helm lint deploy/charts/version-checker
3933

4034
test:
41-
needs:
42-
- setup
4335
name: Run unit tests for Helm Chart
4436
runs-on: ubuntu-latest
4537
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
40+
41+
- name: Setup Golang
42+
uses: actions/setup-go@v5
43+
with:
44+
go-version-file: go.mod
45+
46+
- uses: azure/setup-helm@v4
47+
4648
- name: Install helm Plugins
4749
run: |
4850
if [ ! -e "${HELM_PLUGINS}/helm-unittest" ]; then
@@ -58,13 +60,14 @@ jobs:
5860
helm unittest deploy/charts/version-checker
5961
6062
security_policies:
61-
needs:
62-
- setup
6363
name: Verify that the Helm chart complies with the pod security standards
6464
runs-on: ubuntu-latest
6565
steps:
6666
- name: Checkout code
6767
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
68+
6869
- name: Install Kyverno CLI
6970
uses: kyverno/action-install-cli@v0.2.0
70-
- run: kyverno apply -p https://github.com/kyverno/policies/pod-security/restricted --git-branch main --resource <(helm template deploy/charts/version-checker/)
71+
72+
- run: |-
73+
kyverno apply -p https://github.com/kyverno/policies/pod-security/restricted --git-branch main --resource <(helm template deploy/charts/version-checker/)

.github/workflows/release.yaml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
setup:
16-
name: "Checkout and Setup"
15+
prepare-release:
16+
# Don't push back to a tag!
17+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
18+
name: Prepare release
1719
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: write
22+
contents: write
1823
steps:
1924
- name: Checkout code
2025
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -23,17 +28,6 @@ jobs:
2328
with:
2429
go-version-file: go.mod
2530

26-
prepare-release:
27-
# Don't push back to a tag!
28-
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
29-
name: Prepair release
30-
needs:
31-
- setup
32-
runs-on: ubuntu-latest
33-
permissions:
34-
pull-requests: write
35-
contents: write
36-
steps:
3731
- uses: bhowell2/github-substring-action@1.0.2
3832
id: release_number
3933
with:
@@ -121,10 +115,11 @@ jobs:
121115
allow_no_diff: false
122116

123117
helm-release:
124-
needs:
125-
- setup
126118
runs-on: ubuntu-latest
127119
steps:
120+
- name: Checkout code
121+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
122+
128123
- name: checkout jetstack-charts
129124
uses: actions/checkout@v4
130125
with:
@@ -160,15 +155,15 @@ jobs:
160155
draft: ${{ !startsWith(github.ref, 'refs/tags/') }}
161156

162157
- name: Push to Quay
163-
run: |
164-
CHART_VERSION=$(echo "${{ github.ref_name }}"
165-
helm push jetstack-charts/charts/version-checker-${CHART_VERSION}.tgz oci://quay.io/quay.io/jetstack/version-checker/chart
158+
run: |-
159+
helm push jetstack-charts/charts/version-checker-${{ github.ref_name }}.tgz oci://quay.io/quay.io/jetstack/version-checker/chart
166160
167161
docker-release:
168162
runs-on: ubuntu-latest
169-
needs:
170-
- setup
171163
steps:
164+
- name: Checkout code
165+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
166+
172167
- name: Set up QEMU
173168
uses: docker/setup-qemu-action@v3
174169

pkg/api/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (i *ImageTag) MatchesSHA(sha string) bool {
2626
return true
2727
}
2828
for _, known := range i.Children {
29-
if known.MatchesSHA(sha) {
29+
if known.SHA == sha {
3030
return true
3131
}
3232
}

0 commit comments

Comments
 (0)