Skip to content

fix: dry-run env-var trap + invalid logLevel config key#2

Open
27Bslash6 wants to merge 1 commit into
mainfrom
fix-dryrun-and-loglevel
Open

fix: dry-run env-var trap + invalid logLevel config key#2
27Bslash6 wants to merge 1 commit into
mainfrom
fix-dryrun-and-loglevel

Conversation

@27Bslash6
Copy link
Copy Markdown
Contributor

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant