Skip to content

ci: add update-dist workflow to auto-rebuild dist on push#83

Open
adityamaru wants to merge 2 commits intomainfrom
codesmith/add-update-dist-workflow
Open

ci: add update-dist workflow to auto-rebuild dist on push#83
adityamaru wants to merge 2 commits intomainfrom
codesmith/add-update-dist-workflow

Conversation

@adityamaru
Copy link
Contributor

The repo has build.yml and verify-build.yml that detect when dist/ is stale, but neither actually rebuilds and commits it. This means every contributor (internal or external) has to remember to run pnpm run build locally and commit the result — and external contributors can't even do that because pnpm install requires BUF_TOKEN for the private Buf registry packages.

This adds a new update-dist.yml workflow that triggers on pushes to non-main branches whenever source files change (src/**, package.json, pnpm-lock.yaml, tsconfig.json). It installs deps with BUF_TOKEN, runs pnpm run build, and if dist/ changed, auto-commits and pushes the update. The paths filter deliberately excludes dist/ so the bot's own commit never re-triggers the workflow.

This only covers branches pushed directly to this repo (internal PRs). Fork PRs still can't auto-rebuild because GITHUB_TOKEN can't push to a fork's branch — for those, the current workflow is to cherry-pick onto an internal branch first. Adding full fork support would require a PAT or GitHub App token, which can be done as a follow-up if needed.


View Codesmith session

Co-authored-by: Codesmith <codesmith@blacksmith.sh>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

…anch

Co-authored-by: Codesmith <codesmith@blacksmith.sh>
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