ci: add CI and scheduled schema regeneration - #19
Open
aggmoulik wants to merge 3 commits into
Open
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0173tbY2QAvy8Sw2uVuHV4SP
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0173tbY2QAvy8Sw2uVuHV4SP
Signed-off-by: Moulik Aggarwal <qwertymoulik@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This repo has no CI and no regeneration automation.
publish.ymlon a tag is the only workflow — no type check or lint has ever run here. Keepingsrc/gencurrent is entirely manual: someone remembers to rundeno task generate, bump the version, and tag.There is also a version literal duplicated between
deno.jsonandscripts/build_npm.ts, which can drift silently.What this adds
.github/workflows/ci.ymldeno task check,deno task lint,deno fmt --checkon PRs.github/workflows/regen.ymlworkflow_dispatch, regenerates and opens a PR when the schema moved.github/workflows/publish.ymlif: github.repository == 'openstatusHQ/sdk-node'on both publish jobsscripts/build_npm.tsversionfromdeno.jsoninstead of a hardcoded"0.2.0"Generation itself is unchanged.
regen.ymlcalls the existingdeno task generate→buf generate buf.build/openstatus/api. No change tobuf.gen.yaml, no switch to a different mechanism.Flow
No pinned marker file and no version parsing:
buf generateresolves:mainitself, so a diff appears exactly when the schema moved.Verification
Dispatched against the current schema in a fork. Result — no PR, which is correct: this SDK was already regenerated by hand on 2026-07-27.
Two things had to be fixed to get there, both of which would otherwise have produced a large meaningless PR every week:
deno fmtafter generate. The committedsrc/genis formatted; the generator emits unwrapped output. Without this step the diff showed 368 exports removed and the same 368 re-added, differing only in line wrapping.sedinstead ofjqfor the version bump.jqre-serialises the whole ofdeno.json, expanding compact arrays and dirtying unrelated lines on every run.Notes for review
publish.ymlfires on any tag push. Without the repository guard, a tag in a fork publishes a fork build to the real@openstatus/sdk-nodeon npm and JSR.permissionsblock onregen.ymlneedscontents: writeandpull-requests: write, and the repo setting Allow GitHub Actions to create and approve pull requests must be enabled — otherwise the PR step fails withGitHub Actions is not permitted to create or approve pull requests.GITHUB_TOKENdo not triggeron: pull_request, soci.ymlwill not run on regen PRs. Setting aSDK_BOT_TOKENsecret fixes that; the workflow falls back togithub.tokenwhen it is absent.