Skip to content

Commit d20547e

Browse files
author
Shaw
committed
ci: validate draft CDN assets by commit ref
2 parents cad19c3 + 9b339fe commit d20547e

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/release-electrobun.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ jobs:
315315
- name: Release readiness checks
316316
env:
317317
ELIZA_RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
318+
ELIZA_CDN_VALIDATION_REF: ${{ github.sha }}
318319
ELIZA_VALIDATE_CDN: "1"
319320
run: bun run release:check
320321

packages/app-core/scripts/validate-cdn-assets.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ export function resolveValidationGitRef({
231231
export async function main({ cwd = repoRoot, env = process.env } = {}) {
232232
const releaseTag = resolveElizaReleaseTag({ env });
233233
const gitSha = resolveCurrentGitSha({ cwd, env });
234+
const explicitValidationRef = env.ELIZA_CDN_VALIDATION_REF?.trim();
234235
const repository = resolveElizaAssetRepository({ env });
235236
if (!releaseTag && !gitSha) {
236237
throw new Error(
@@ -255,8 +256,12 @@ export async function main({ cwd = repoRoot, env = process.env } = {}) {
255256
// commit SHA so we still verify the assets exist in the repo at this
256257
// commit. raw.githubusercontent.com resolves any git ref — branch, tag,
257258
// or full SHA — so the check is equivalent.
258-
let effectiveRef = releaseTag || gitSha;
259-
if (!releaseTag && gitSha) {
259+
let effectiveRef = explicitValidationRef || releaseTag || gitSha;
260+
if (explicitValidationRef) {
261+
console.log(
262+
`validate-cdn-assets: validating against explicit ref ${explicitValidationRef}${releaseTag ? ` for pending tag ${releaseTag}` : ""}.`,
263+
);
264+
} else if (!releaseTag && gitSha) {
260265
console.log(
261266
`validate-cdn-assets: no release tag provided, validating against commit SHA ${gitSha.slice(0, 12)}.`,
262267
);

0 commit comments

Comments
 (0)