Repository navigation
feat!: require env vars of test versions in sync with the default version - #217
Merged
Merged
Conversation
… env vars `build` and `build-from-local` take `--require-env-vars-in-sync`, which fails the build, dry runs included, when the version being built has env vars with different names than the Actor's default version, so tests run with the same configuration users do. Only names are compared because the API doesn't return secret values. Off by default, so one-off builds (e.g. a debug branch) aren't held up; `public_pr-build-test.yaml` turns it on with the new `require-env-vars-in-sync` input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uf4mMpBhZCNatL6cLh2Ywt
`public_pr-build-test.yaml`'s `require-env-vars-in-sync` input now defaults to `true`. Repos opt out with `require-env-vars-in-sync: false`. The CLI flag stays off by default, so one-off builds aren't held up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uf4mMpBhZCNatL6cLh2Ywt
metalwarrior665
marked this pull request as ready for review
October 23, 2026 08:51
metalwarrior665
requested review from
JuanGalilea and
ruocco-l
as code owners
October 23, 2026 08:51
JuanGalilea
approved these changes
Oct 26, 2026
JuanGalilea
left a comment
Contributor
There was a problem hiding this comment.
good initial step on having proper env stuff.
don't like it as a long term thing, but this will protect us from dumb mistakes nonetheless
Member
Author
I think this could stay as a simple default base level protection. While the env from GitHub would be for devs who want to automate and customize more. |
ruocco-l
approved these changes
Oct 26, 2026
ruocco-l
left a comment
Contributor
There was a problem hiding this comment.
I don't particularly like the fact that we are forcing users to interact with console to add manually a secret to have a correct sync every time they want to add a new secret, but as of now we still have to do it and this just adds the check, so all good 👍
Member
Author
|
Will merge in 2-3 days to give devs time to read the Slack post |
…-8pcp7n # Conflicts: # .github/cli/apify-test-tools.mjs # README.md
…-8pcp7n # Conflicts: # .github/workflows/public_pr-build-test.yaml
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.
Tests should run an Actor with the same env vars users run it with. This adds a check that the version being built has env vars with the same names as the Actor's default version. Only names are compared, because the API doesn't return secret values.
Changes
buildandbuild-from-localtake--require-env-vars-in-sync, off by default so one-off builds (e.g. of a debug branch) aren't held up. When set, the build fails if a name is missing or extra, e.g.Env vars of version 0.99 are out of sync with default version 0.1 (missing A; extra C). A dry run checks it too.buildcompares whatever--version-numberresolves to;build-from-localcompares0.98.public_pr-build-test.yamlgets arequire-env-vars-in-syncinput that defaults totrueand passes the flag tobuild. Repos opt out with:docs/cli.md, input row indocs/workflows.md. CLI bundle rebuilt.Breaking
Once
workflows-v0moves, PR builds fail in repos whose0.99version has different env var names than the default version. They need to align the env vars on the platform or set the input tofalse. This stays onworkflows-v0since we're before v1.Testing
buildandbuild-from-localwith and without the flag.npm test,tsc, eslint and prettier pass. Checked that yargs parses--require-env-vars-in-sync=true/=falseas booleans, and ran the bundled CLI with the flag.🤖 Generated with Claude Code
https://claude.ai/code/session_01Uf4mMpBhZCNatL6cLh2Ywt