· 2 min read
A workflow that can't push
Faster e2e on CI: fullyParallel with one worker per core, and the Google Chrome the runner already has (channel: 'chrome') instead of downloading Chromium…
What we did
- Faster e2e on CI:
fullyParallelwith one worker per core, and the Google Chrome the runner already has (channel: 'chrome') instead of downloading Chromium (that step took 27 s). - The build job only reads the repo now (
contents: read) and checks out withpersist-credentials: false, so the token isn't left in.git/configfor the build's scripts to find. - A new
image-cachejob is the only one that can push: it checks out, downloads the build's.image-cacheartifact and commits it. It runs no code from the repo or its packages. pages: writeandid-token: writemoved from the whole workflow to the deploy job.- Every action is pinned to a commit SHA with the version in a comment, and
.github/dependabot.ymlopens a weekly PR when they move (only releases at least 7 days old). concurrencyper branch: a new push to a PR cancels its older run; runs onmainqueue, so two cache commits never race.- Dropped the
minimumReleaseAgeExcludefor@sveltia/cms: 0.268.0 is old enough now.
What I learned
- A job's permissions are what any script in it can do. The build runs code from hundreds of packages, so it shouldn't hold a token that can push.
- A tag like
v7can be moved to point at other code; a commit SHA can't. Dependabot is what keeps SHA pins from going stale. upload-artifactskips hidden files by default, and.image-cachestarts with a dot:include-hidden-files: true.
Next
- Watch the first run on
maincommit the cache from the new job.