0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/.github/workflows/version-packages.yml
Ward Peeters 32e92b3cb0
ci: speed up the release versioning checkout with a partial clone (#26976)
## Summary

The **Version Packages** workflow (and **Cron Alpha Publish**, which
uses the same pattern) re-checks out the repository with the app token
and `fetch-depth: 0`, so Changesets can find the commit that added each
changeset for changelogs. That full-history fetch downloads every
historical version of every file and took **137s** in [this
run](https://github.com/mastra-ai/mastra/actions/runs/38520173688/job/115707828838),
which is most of the job.

This adds `filter: blob:none` to that checkout. The clone keeps the full
commit graph and all trees, so history lookups work unchanged. Old file
contents are fetched on demand only if something reads them.
`lint-docs.yml`, `prebuild.yml` and others already use the same setting.

## Verification (local, against mastra-ai/mastra)
- `--filter=blob:none` full-history clone of `main`: **9s**, 60 MiB, all
21k commits
- `git log --diff-filter=A --max-count=1 --pretty=format:%H:%P --
<changeset>` (what `@changesets/git` runs) returns identical results to
a full clone for every pending changeset, with no on-demand blob fetches
- `@napi-rs/simple-git` (used by `changesets-changelog-github-local`)
opens the partial clone (`repositoryformatversion = 1`), reports it as
not shallow, and reads commit messages
- Reading an old file version (`git show <old>:package.json`) still
works via on-demand fetch
- Steps after checkout (working-tree diffs, commit, rebase, push) don't
need historical blobs

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## ELI5

The release workflows need Git history to find changes, but they do not
need every old file version. This change lets them download the history
first and fetch old file data only if needed.

## Changes

- Added `filter: blob:none` to the full-history, app-token checkout in
the Cron Alpha Publish workflow.
- Added the same filter to the full-history, app-token checkout in the
Version Packages workflow.
- Kept `fetch-depth: 0` in both workflows, so both still fetch the full
commit history.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-13 23:58:59 -07:00

99 lines
3.7 KiB