Skip to content

fix(publish): create spec dir on first publish into a pristine hub#10

Merged
dean-harel-unipaas merged 1 commit into
mainfrom
fix/publish-mkdir-spec-dir
Jun 17, 2026
Merged

fix(publish): create spec dir on first publish into a pristine hub#10
dean-harel-unipaas merged 1 commit into
mainfrom
fix/publish-mkdir-spec-dir

Conversation

@dean-harel-unipaas

Copy link
Copy Markdown
Contributor

Why

The baseline redrive (production pipeline) failed: ENOENT: copyfile '/tmp/openapi.json' -> 'spec/openapi.json'. The hub reset removed the spec/ directory, and publish.ts assumed it always existed (the hub was originally bootstrapped with a committed spec). The first publish into a pristine hub has no spec/ dir.

Fix

fs.mkdirSync(path.dirname(SPEC_JSON), { recursive: true }) before writing the spec.

Validation

Ran the fixed script locally against a pristine clone (origin pointed at a throwaway bare repo, no token): it created spec/, wrote openapi.json/openapi.yaml/provenance.json, committed and pushed, and produced a clean Initial published spec. changelog entry. It stopped only at the release step (no token), which is downstream of this fix.

publish.ts assumed spec/ already existed (the hub was bootstrapped with a committed
spec). On a first publish into a pristine hub the directory is absent and copyFileSync
fails with ENOENT. mkdir -p the spec dir before writing. Validated locally end-to-end:
pristine hub -> clean 'Initial published spec.' baseline, files written, commit+push OK.
@dean-harel-unipaas
dean-harel-unipaas merged commit 030941e into main Jun 17, 2026
1 check passed
@dean-harel-unipaas
dean-harel-unipaas deleted the fix/publish-mkdir-spec-dir branch June 17, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant