Repository navigation
GitHub Action installs Aster and exposes the cache token only to Aster - #173
Merged
calvin-archastro merged 2 commits intoOct 21, 2026
Conversation
The action installs a pinned release, or a test-only local binary, and passes the Actions cache token only to the spawned aster process. auto mode writes on push, schedule, and workflow_dispatch to the default branch.
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.
Epic: Aster restores real build artifacts from a shared cache, including the GitHub Actions cache
Task: GitHub Action installs Aster and exposes the cache token only to Aster
Local git hooks skipped: pre-push on the submission push and the publish push. CI is the gate for what those hooks check.
Problem and author intent
Workflows had no in-repo way to install a pinned Aster release and run one command against the GitHub Actions cache. The cache client already speaks the Actions cache API, but nothing installed the binary or passed
ACTIONS_RESULTS_URL,ACTIONS_RUNTIME_TOKEN,ASTER_REMOTE_CACHE=gha, andASTER_CACHE_MODEonly to that process. Exporting the runtime token into the job environment would leave a write-capable credential available to later steps.The author intent is a Node 24 JavaScript action under
action/, used asArchAstro/aster/action@vX, that installs Aster, selects cache mode, and scopes those variables to the spawnedasterprocess.autoshould write only forpush,schedule, andworkflow_dispatchon the default branch, and read otherwise. A hiddenaster-pathinput should skip the release download so tests can use a local binary. The GHA cache client previously always pinned TLS roots to WebPKI, so a loopback HTTPS fake could not stand in for the Actions cache without a test-only trust hook.What changed
Before, there was no action, and
build_agentinsrc/cache/gha/client.rsalways setRootCerts::WebPki. A private loopback certificate failed verification, and any workflow that wanted the cache token had to plumb it itself, including the risk ofcore.exportVariable/GITHUB_ENVleaking it forward.After,
action/action.ymlrunsdist/index.json Node 24 with inputsversion,run,cache-mode(defaultauto),working-directory, and test-onlyaster-path.action/src/index.tsresolves the default branch fromGITHUB_EVENT_PATH, installs Aster, and spawns the command.selectCacheModereturnsrwonly when the event ispush,schedule, orworkflow_dispatch, the default branch is non-empty, andrefisrefs/heads/<default>. Missing payload, pull requests, and other branches stayread. Explicitrw,read, andoffoverride that; anything else throws. Emptyversionpicks the first non-draft, non-prerelease tag from the first 20 GitHub releases; a set version accepts an optional leadingv. Install uses the tool cache and release assetsaster-linux-x64.tar.gz,aster-darwin-x64.tar.gz, andaster-darwin-arm64.tar.gz, thenchmod +x.aster-pathreturns that local binary if it exists.childEnvcopies the parent environment and setsACTIONS_RESULTS_URL,ACTIONS_RUNTIME_TOKEN,ASTER_REMOTE_CACHE=gha, andASTER_CACHE_MODEon the object passed to@actions/exec.action/srcdoes not callexportVariableorexportSecret.splitCommandsplitsrunon whitespace and does not interpret quotes. A non-zero aster exit fails the step.build_agentno longer hard-codesRootCerts::WebPki. IfASTER_GHA_EXTRA_CAis unset or empty, roots are left to the builder (the new comment says that keeps WebPKI). If it is set, that one PEM replaces WebPKI viaRootCerts::new_with_certs, because ureq's specific-root mode cannot add to WebPKI. A missing file or non-PEM panics. The integration test sets this so its loopback server is the only host the client talks to.Docs in
action/README.mdanddocs/ci/github-actions.mddescribe the usage and the non-export..gitignoreignoresnode_modules/..github/workflows/ci.ymladds anactionjob onubuntu-latestthat checks out, sets up Node 24, installs the Rust toolchain, and runsnpm cithennpm testinaction/.Both frozen revisions (heads
61b59cf9d9628b02cc7d2d0f5e148ee4eb72741eandca4996dd8eb999b931283fc8b47ea46c95481a2b, same base) carry this change. The later head only reformats the extra-CA panic lines; visible behavior matches.Scope
Same 24 paths in both revisions: new
action/sources, tests, fixture, package metadata, nccdist/outputs, CI job, docs,.gitignore, andsrc/cache/gha/client.rs. About 31,661–31,663 lines added and 5 removed across 28 hunks; almost all of the addition is the committed bundle and lockfile. One hunk per revision was omitted.action/dist/index.jsis truncated in the first revision and absent from the second revision's excerpts, so the bundle was not fully reviewed.Risk assessment
Medium. The action handles a write-capable Actions runtime token. The mitigation in the visible source is process-scoped
execenv, notcore.exportVariable. It does not strip a token the runner already injected into the job.cache-mode: rwcan still be set explicitly on pull requests.ASTER_GHA_EXTRA_CAreplaces WebPKI rather than adding a root. If set outside the test, the client trusts only that certificate and will not validate the real Actions cache with WebPKI. The explicit.root_certs(RootCerts::WebPki)call was removed; production trust when the variable is unset now depends on the ureq builder default, which the comment claims is WebPKI but which these excerpts do not prove.Install is unix-oriented (
extractTar,chmod +x) and has no Windows asset.latestTagonly inspects 20 releases. Whitespace splitting will mis-handle quoted arguments. The omitted hunk and truncated bundle are review gaps, not evidence the bundle matchessrc/.User impact
Workflows can install Aster and run one command with the Actions cache enabled, for example
uses: ArchAstro/aster/action@v0.21.0withrun: run //app:build. Defaultautowrites on default-branchpush,schedule, andworkflow_dispatch, and reads otherwise. Later steps are not given the token through this action's env export. Unsupported platforms fail at asset selection. UnsetASTER_GHA_EXTRA_CAis the production path; setting it changes TLS trust for the cache client.Testing
Canonical tests added in-tree, not proven by the supplied check excerpts:
action/test/mode.test.js:push to the default branch selects rw,schedule on the default branch selects rw,workflow_dispatch on the default branch selects rw,pull_request selects read,push to a non-default branch selects read,cache-mode input overrides auto, andrun does not export ACTIONS_RUNTIME_TOKEN(source must not callexportVariable/exportSecret;childEnvsets the token only on the returned env).action/test/integration.test.js:second aster run reports the fixture target cached. It runsdist/index.jswith a localasterviaaster-path, a fake event payload, and an in-test TLS Twirp/blob server. It expects a cache miss then a hit for//app:build, the bearer token on the fake server, restoredout/file.txt, a single command execution, and no runtime token or results URL on the parent test process.CI wiring is the new
actionjob (npm ciandnpm test). That is intent, not a passed run. Advisory pipeline outcomes reportformat,lint, andtestsucceeded, but those excerpts are truncated and the visibletesttext is Rust (migrations, startup, ui, upgrade), not the Node action tests. No supplied check id isaction. Author-reported localnpm test(8 passed) is not treated as CI evidence. Patch presence is not proof those tests passed.Follow-ups and known issues
dist/index.js, and truncated check excerpts. Do not treat the bundle or CI action job as fully verified.chmod +xwill not fit a Windows runner.runis not a shell; quotes are not interpreted.ASTER_GHA_EXTRA_CAmust stay unset in production. Confirm the ureq default is still WebPKI now that the explicitRootCerts::WebPkicall is gone.npm testdoes not use the network. The integration test uses loopback TLS,openssl, and maycargo builda localaster; it is written to avoid GitHub and published releases, but that was not re-run in the supplied pipeline excerpts.