Skip to content

Commit 21ed9fa

Browse files
[minor] Pin stable template provenance (#37)
* [minor] Pin stable template provenance * [skip-release] Match generated lock YAML
1 parent 1e363de commit 21ed9fa

7 files changed

Lines changed: 32 additions & 10 deletions

File tree

.github/workflows/integration-test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ jobs:
2323
create_args: ""
2424
steps:
2525
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
26+
with:
27+
persist-credentials: false
2628

2729
- name: Set up Go
2830
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16
2931
with:
3032
go-version: "1.26.x"
3133

3234
- name: Install sitectl
33-
uses: libops/.github/.github/actions/install-sitectl@da242aa070fa29b4028c5e03884b69857ea13fdf # main
35+
uses: libops/.github/.github/actions/install-sitectl@90a9272d0829c878a682ba636bc155c2b06c7939 # main
36+
with:
37+
packages: sitectl
38+
package-versions: sitectl=0.40.0
39+
allow-unversioned: false
3440

3541
- name: setup git identity
3642
run: |

.goreleaser.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
before:
33
hooks:
4-
- ./scripts/check-sitectl-core-version.sh v0.38.0
4+
- ./scripts/check-sitectl-core-version.sh v0.40.0
55
- go mod tidy
66
builds:
77
- binary: sitectl-drupal
@@ -72,10 +72,10 @@ nfpms:
7272
overrides:
7373
deb:
7474
dependencies:
75-
- sitectl (>= 0.38.0)
75+
- sitectl (>= 0.40.0)
7676
rpm:
7777
dependencies:
78-
- sitectl >= 0.38.0
78+
- sitectl >= 0.40.0
7979
apk:
8080
dependencies:
81-
- sitectl>=0.38.0
81+
- sitectl>=0.40.0

cmd/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "github.com/libops/sitectl/pkg/plugin"
44

55
const (
66
drupalCreateRepo = "https://github.com/libops/drupal"
7-
drupalCreateBranch = "main"
7+
drupalCreateBranch = "v1.0.0"
88
drupalCreateDrupalRoot = "."
99
drupalContainerRoot = "/var/www/drupal"
1010
)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/libops/sitectl-drupal
33
go 1.26.1
44

55
require (
6-
github.com/libops/sitectl v0.38.0
6+
github.com/libops/sitectl v0.40.0
77
github.com/spf13/cobra v1.10.2
88
gopkg.in/yaml.v3 v3.0.1
99
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
8282
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
8383
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
8484
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
85-
github.com/libops/sitectl v0.38.0 h1:QyaquU/+E3OS2yEQQnGi/dkCPpT+jGYYLJulPOSfqnE=
86-
github.com/libops/sitectl v0.38.0/go.mod h1:+MB7d95kz2/MbNSRB2gTlSwDg6swsFjh4zI5gC6rb+k=
85+
github.com/libops/sitectl v0.40.0 h1:LmlaqnCybdaT391nTe8tQvH4NYKDLdCcbNNjYluntv4=
86+
github.com/libops/sitectl v0.40.0/go.mod h1:+MB7d95kz2/MbNSRB2gTlSwDg6swsFjh4zI5gC6rb+k=
8787
github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4=
8888
github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
8989
github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU=

scripts/check-sitectl-core-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
set -eu
33

4-
minimum="${1:-v0.38.0}"
4+
minimum="${1:-v0.40.0}"
55
version="$(GOWORK=off go list -m -f '{{.Version}}' github.com/libops/sitectl)"
66

77
case "$version" in

scripts/test-create.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ build_plugin() {
4848
command -v "${PLUGIN_BINARY}" >/dev/null
4949
}
5050

51+
assert_template_lock() {
52+
local lock="${SITE_DIR}/.libops/template.lock.yaml"
53+
if [ -L "${lock}" ] || [ ! -f "${lock}" ]; then
54+
echo "sitectl create did not retain a regular template provenance lock" >&2
55+
return 1
56+
fi
57+
test "$(stat -c '%a' "${lock}")" = "644"
58+
grep -Fxq 'apiVersion: sitectl.libops.io/v1alpha1' "${lock}"
59+
grep -Fxq 'kind: TemplateLock' "${lock}"
60+
grep -Eq '^ commit: [0-9a-f]{40}([0-9a-f]{24})?$' "${lock}"
61+
grep -Fxq " repository: https://github.com/libops/${PLUGIN_NAME}" "${lock}"
62+
grep -Eq '^ digest: sha256:[0-9a-f]{64}$' "${lock}"
63+
grep -Fxq ' revision: v1.0.0' "${lock}"
64+
}
65+
5166
create_site() {
5267
local target="${PLUGIN_NAME}/${CREATE_DEFINITION}"
5368
local extra_args=()
@@ -61,6 +76,7 @@ create_site() {
6176
--checkout-source template \
6277
--default-context \
6378
"${extra_args[@]}"
79+
assert_template_lock
6480
}
6581

6682
run_healthcheck() {

0 commit comments

Comments
 (0)