fix: dry-run env-var trap + invalid logLevel config key#2
Open
27Bslash6 wants to merge 1 commit into
Open
Conversation
First scheduled run surfaced two latent bugs from PR #1. 1. Inline `RENOVATE_DRY_RUN: ${{ inputs.dry-run == 'disabled' && '' || inputs.dry-run }}` always resolved to the literal string 'disabled' (GHA's `||` operator returns its RHS when the LHS is falsy, and an empty string IS falsy). Renovate then saw RENOVATE_DRY_RUN=disabled, interpreted any non-null value as dry-run enabled, and silently DRY-RAN every onboarding PR. Fix: write to $GITHUB_ENV in a separate conditional step that only runs when dry-run is actually requested. The Run Renovate step inherits the env var or doesn't, with no falsy-fallback hazard. 2. `logLevel: 'info'` in config.js caused "Invalid configuration option: logLevel" warnings. Renovate distinguishes runtime config (env vars only) from policy config (this file); log level is runtime. Removed. The workflow log-level input still works correctly: it sets the LOG_LEVEL env var on the Renovate step.
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.
First scheduled run of #1 surfaced two latent bugs.
Bugs
1. Dry-run trap
The inline expression I wrote:
```yaml
RENOVATE_DRY_RUN: ${{ inputs.dry-run == 'disabled' && '' || inputs.dry-run }}
```
…always resolved to the literal string `'disabled'` when no dry-run was requested. GHA's `||` returns its RHS when the LHS is falsy, and empty string is falsy in GHA expressions. So the chain was:
`true && ''` → `''` → `'' || 'disabled'` → `'disabled'`
Renovate then saw `RENOVATE_DRY_RUN=disabled` and (treating any non-null value as enabled) silently dry-ran every onboarding PR. Every "DRY-RUN: Would create onboarding PR" line in the first run's logs was this.
Fix: write the env var to `$GITHUB_ENV` in a separate `if:`-gated step. No falsy-fallback hazard.
2. Invalid `logLevel` config key
`logLevel: 'info'` in `config.js` produced `Invalid configuration option: logLevel` warnings. Renovate distinguishes runtime config (env vars only) from policy config (this file); log level is runtime. Removed.
The `log-level` workflow_dispatch input still works — it sets the `LOG_LEVEL` env var on the Renovate step.
Verification path
Merge → manually trigger workflow → expect actual onboarding PRs to appear on `strategy`, `tooling`, `brochure` (the repos without renovate.json) plus dependency dashboard issues on every scanned repo.