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
66 changes: 52 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,34 @@ jobs:
if (typeof attestationsUrl !== "string") {
throw new Error(`${name}@${process.env.RELEASE_VERSION} has no npm provenance.`);
}
const attestationsResponse = await fetch(attestationsUrl, {
signal: AbortSignal.timeout(15_000),
});
if (!attestationsResponse.ok) {
throw new Error(`The npm attestation registry returned HTTP ${attestationsResponse.status}.`);
let attestations;
for (let attempt = 1; attempt <= 12; attempt++) {
const response = await fetch(attestationsUrl, {
signal: AbortSignal.timeout(15_000),
});
if (response.ok) {
attestations = await response.json();
if (
attestations.attestations?.some(
(item) =>
item.predicateType === "https://slsa.dev/provenance/v1" &&
item.bundle?.dsseEnvelope?.payload,
)
) {
break;
}
} else if (response.status !== 404) {
throw new Error(`The npm attestation registry returned HTTP ${response.status}.`);
}
if (attempt === 12) {
throw new Error(`${name}@${process.env.RELEASE_VERSION} has no SLSA provenance.`);
}
await new Promise((resolve) => setTimeout(resolve, 5_000));
}
const attestations = await attestationsResponse.json();
const provenance = attestations.attestations?.find(
(item) => item.predicateType === "https://slsa.dev/provenance/v1",
(item) =>
item.predicateType === "https://slsa.dev/provenance/v1" &&
item.bundle?.dsseEnvelope?.payload,
);
if (!provenance?.bundle?.dsseEnvelope?.payload) {
throw new Error(`${name}@${process.env.RELEASE_VERSION} has no SLSA provenance.`);
Expand Down Expand Up @@ -337,15 +356,34 @@ jobs:
if (metadata.dist?.integrity !== process.env.NPM_INTEGRITY) {
throw new Error("The published npm package has different bytes.");
}
const attestationsResponse = await fetch(metadata.dist.attestations.url, {
signal: AbortSignal.timeout(15_000),
});
if (!attestationsResponse.ok) {
throw new Error(`The npm attestation registry returned HTTP ${attestationsResponse.status}.`);
let attestations;
for (let attempt = 1; attempt <= 12; attempt++) {
const response = await fetch(metadata.dist.attestations.url, {
signal: AbortSignal.timeout(15_000),
});
if (response.ok) {
attestations = await response.json();
if (
attestations.attestations?.some(
(item) =>
item.predicateType === "https://slsa.dev/provenance/v1" &&
item.bundle?.dsseEnvelope?.payload,
)
Comment thread
slate-rehm marked this conversation as resolved.
) {
break;
}
} else if (response.status !== 404) {
throw new Error(`The npm attestation registry returned HTTP ${response.status}.`);
}
if (attempt === 12) {
throw new Error("The npm provenance did not become available.");
}
await new Promise((resolve) => setTimeout(resolve, 5_000));
Comment thread
slate-rehm marked this conversation as resolved.
}
const attestations = await attestationsResponse.json();
const provenance = attestations.attestations?.find(
(item) => item.predicateType === "https://slsa.dev/provenance/v1",
(item) =>
item.predicateType === "https://slsa.dev/provenance/v1" &&
item.bundle?.dsseEnvelope?.payload,
);
if (!provenance?.bundle?.dsseEnvelope?.payload) {
throw new Error("The npm package has no SLSA provenance.");
Expand Down
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@secret-effects/api",
"version": "0.2.2",
"version": "0.2.3",
"private": true,
"type": "module",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@secret-effects/cli",
"version": "0.2.2",
"version": "0.2.3",
"private": true,
"type": "module",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "secret-effects",
"version": "0.2.2",
"version": "0.2.3",
"private": true,
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paperkeel/secret-effects-client",
"version": "0.2.2",
"version": "0.2.3",
"description": "Type-safe Secret Effects environment loading for Node.js and Cloudflare Workers",
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@secret-effects/crypto",
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"license": "MIT",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@secret-effects/protocol",
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"license": "MIT",
"exports": {
Expand Down
Loading