Skip to content

Commit 0661cd6

Browse files
Merge pull request #146 from step-security/auto-cherry-pick
chore: Cherry-picked changes from upstream
2 parents 13d8f21 + c086f9d commit 0661cd6

3 files changed

Lines changed: 26 additions & 15 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Harden Runner
19-
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
19+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
2020
with:
2121
egress-policy: audit
2222

2323
-
2424
name: Checkout
25-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626
-
2727
name: Test
28-
uses: docker/bake-action@f6acc70fe0da9b200315017ca49a08c0de03aa0b # v5.1.0
28+
uses: docker/bake-action@212c36739681a6271d58dcfe0d001d2ad13f8e75 # v6.7.0
2929
with:
3030
targets: test
3131

.github/workflows/validate.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ jobs:
1515
prepare:
1616
runs-on: ubuntu-latest
1717
outputs:
18-
targets: ${{ steps.targets.outputs.matrix }}
18+
targets: ${{ steps.generate.outputs.targets }}
1919
steps:
2020
- name: Harden Runner
21-
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
21+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
2222
with:
2323
egress-policy: audit
2424

2525
-
2626
name: Checkout
27-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
-
29-
name: Targets matrix
30-
id: targets
31-
run: |
32-
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
29+
name: List targets
30+
id: generate
31+
uses: docker/bake-action/subaction/list-targets@212c36739681a6271d58dcfe0d001d2ad13f8e75 # v6.7.0
32+
with:
33+
target: validate
3334

3435
validate:
3536
runs-on: ubuntu-latest
@@ -41,15 +42,12 @@ jobs:
4142
target: ${{ fromJson(needs.prepare.outputs.targets) }}
4243
steps:
4344
- name: Harden Runner
44-
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
45+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
4546
with:
4647
egress-policy: audit
4748

48-
-
49-
name: Checkout
50-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5149
-
5250
name: Validate
53-
uses: docker/bake-action@f6acc70fe0da9b200315017ca49a08c0de03aa0b # v5.1.0
51+
uses: docker/bake-action@212c36739681a6271d58dcfe0d001d2ad13f8e75 # v6.7.0
5452
with:
5553
targets: ${{ matrix.target }}

docker-bake.hcl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
target "_common" {
2+
args = {
3+
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
4+
}
5+
}
6+
17
group "default" {
28
targets = ["build"]
39
}
@@ -11,42 +17,49 @@ group "validate" {
1117
}
1218

1319
target "build" {
20+
inherits = ["_common"]
1421
dockerfile = "dev.Dockerfile"
1522
target = "build-update"
1623
output = ["."]
1724
}
1825

1926
target "build-validate" {
27+
inherits = ["_common"]
2028
dockerfile = "dev.Dockerfile"
2129
target = "build-validate"
2230
output = ["type=cacheonly"]
2331
}
2432

2533
target "format" {
34+
inherits = ["_common"]
2635
dockerfile = "dev.Dockerfile"
2736
target = "format-update"
2837
output = ["."]
2938
}
3039

3140
target "lint" {
41+
inherits = ["_common"]
3242
dockerfile = "dev.Dockerfile"
3343
target = "lint"
3444
output = ["type=cacheonly"]
3545
}
3646

3747
target "vendor-update" {
48+
inherits = ["_common"]
3849
dockerfile = "dev.Dockerfile"
3950
target = "vendor-update"
4051
output = ["."]
4152
}
4253

4354
target "vendor-validate" {
55+
inherits = ["_common"]
4456
dockerfile = "dev.Dockerfile"
4557
target = "vendor-validate"
4658
output = ["type=cacheonly"]
4759
}
4860

4961
target "test" {
62+
inherits = ["_common"]
5063
dockerfile = "dev.Dockerfile"
5164
target = "test-coverage"
5265
output = ["./coverage"]

0 commit comments

Comments
 (0)