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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test/** export-ignore
15 changes: 12 additions & 3 deletions .github/workflows/bake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -551,14 +551,23 @@ jobs:
INPUT_IMAGE-DIGEST: ${{ steps.get-image-digest.outputs.digest }}
with:
script: |
// FIXME: remove once https://github.com/docker/github-builder-experimental/issues/30 is resolved
await new Promise(resolve => setTimeout(resolve, 2000));

const { Sigstore } = require('@docker/actions-toolkit/lib/sigstore/sigstore');

const inpImageNames = core.getMultilineInput('image-names');
const inpImageDigest = core.getInput('image-digest');

// ECR registry regexes: https://github.com/docker/login-action/blob/28fdb31ff34708d19615a74d67103ddc2ea9725c/src/aws.ts#L8-L9
const ecrRegistryRegex = /^(([0-9]{12})\.(dkr\.ecr|dkr-ecr)\.(.+)\.(on\.aws|amazonaws\.com(.cn)?))(\/([^:]+)(:.+)?)?$/;
const ecrPublicRegistryRegex = /public\.ecr\.aws|ecr-public\.aws\.com/;
for (const imageName of inpImageNames) {
if (ecrRegistryRegex.test(imageName) || ecrPublicRegistryRegex.test(imageName)) {
core.info(`Detected ECR image name: ${imageName}, adding delay to mitigate eventual consistency issue`);
// FIXME: remove once https://github.com/docker/github-builder-experimental/issues/30 is resolved
await new Promise(resolve => setTimeout(resolve, 5000));
break;
}
}

const sigstore = new Sigstore();
const signResults = await sigstore.signAttestationManifests({
imageNames: inpImageNames,
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,23 @@ jobs:
INPUT_IMAGE-DIGEST: ${{ steps.build.outputs.digest }}
with:
script: |
// FIXME: remove once https://github.com/docker/github-builder-experimental/issues/30 is resolved
await new Promise(resolve => setTimeout(resolve, 2000));

const { Sigstore } = require('@docker/actions-toolkit/lib/sigstore/sigstore');

const inpImageNames = core.getMultilineInput('image-names');
const inpImageDigest = core.getInput('image-digest');

// ECR registry regexes: https://github.com/docker/login-action/blob/28fdb31ff34708d19615a74d67103ddc2ea9725c/src/aws.ts#L8-L9
const ecrRegistryRegex = /^(([0-9]{12})\.(dkr\.ecr|dkr-ecr)\.(.+)\.(on\.aws|amazonaws\.com(.cn)?))(\/([^:]+)(:.+)?)?$/;
const ecrPublicRegistryRegex = /public\.ecr\.aws|ecr-public\.aws\.com/;
for (const imageName of inpImageNames) {
if (ecrRegistryRegex.test(imageName) || ecrPublicRegistryRegex.test(imageName)) {
core.info(`Detected ECR image name: ${imageName}, adding delay to mitigate eventual consistency issue`);
// FIXME: remove once https://github.com/docker/github-builder-experimental/issues/30 is resolved
await new Promise(resolve => setTimeout(resolve, 5000));
break;
}
}

const sigstore = new Sigstore();
const signResults = await sigstore.signAttestationManifests({
imageNames: inpImageNames,
Expand Down