Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/lint-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ jobs:
publish:
if: github.event_name != 'pull_request'
needs: [lint-test]
uses: libops/.github/.github/workflows/build-push.yaml@a86300fb8020d0f7141bb9f833d89b5dbd7aa4d7 # guarded-signed-image-publisher
uses: libops/.github/.github/workflows/build-push.yaml@main
with:
ref: ${{ github.sha }}
expected-main-sha: ${{ github.ref == 'refs/heads/main' && github.sha || '' }}
additional-gar-registry: us-docker.pkg.dev/libops-images/public
scan: true
sign: true
certificate-identity: https://github.com/libops/.github/.github/workflows/build-push.yaml@a86300fb8020d0f7141bb9f833d89b5dbd7aa4d7
permissions:
contents: read
packages: write
Expand Down
8 changes: 4 additions & 4 deletions ci/workflow_contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"testing"
)

const sharedPublisherSHA = "a86300fb8020d0f7141bb9f833d89b5dbd7aa4d7"

func repositoryRoot(t *testing.T) string {
t.Helper()
_, current, _, ok := runtime.Caller(0)
Expand All @@ -32,12 +30,11 @@ func readRepositoryFile(t *testing.T, path ...string) string {
func TestImagePublicationUsesGuardedSharedContract(t *testing.T) {
workflow := readRepositoryFile(t, ".github", "workflows", "lint-test-build.yml")
for _, required := range []string{
"libops/.github/.github/workflows/build-push.yaml@" + sharedPublisherSHA,
"libops/.github/.github/workflows/build-push.yaml@main",
"additional-gar-registry: us-docker.pkg.dev/libops-images/public",
"expected-main-sha:",
"scan: true",
"sign: true",
"certificate-identity: https://github.com/libops/.github/.github/workflows/build-push.yaml@" + sharedPublisherSHA,
"GCLOUD_OIDC_POOL: ${{ secrets.GCLOUD_OIDC_POOL }}",
"GSA: ${{ secrets.GSA }}",
} {
Expand All @@ -48,6 +45,9 @@ func TestImagePublicationUsesGuardedSharedContract(t *testing.T) {
if strings.Contains(workflow, "secrets: inherit") {
t.Fatal("image workflow must map only its required registry secrets")
}
if strings.Contains(workflow, "certificate-identity:") {
t.Fatal("image workflow must not override the managed publisher identity")
}
}

func TestReleaseImageCallMapsOnlyRegistrySecrets(t *testing.T) {
Expand Down
Loading