Skip to content

feat: pass all LOG_* environment variables to the Renovate container#1036

Open
ruzickap wants to merge 1 commit into
renovatebot:mainfrom
ruzickap:fix/env-regex-log-file
Open

feat: pass all LOG_* environment variables to the Renovate container#1036
ruzickap wants to merge 1 commit into
renovatebot:mainfrom
ruzickap:fix/env-regex-log-file

Conversation

@ruzickap

@ruzickap ruzickap commented Jun 9, 2026

Copy link
Copy Markdown

Description

Renovate supports several logging-related environment variables that are loaded
before configuration parsing (docs):

  • LOG_CONTEXT
  • LOG_FILE
  • LOG_FILE_FORMAT
  • LOG_FILE_LEVEL
  • LOG_FORMAT
  • LOG_LEVEL

Currently the default env-regex only allows LOG_LEVEL through to the
Docker container. Users who want to use LOG_FILE (to enable file logging)
must override the entire env-regex input just to add one variable.

This PR changes the default pattern from LOG_LEVEL to LOG_\w+ so that
all Renovate logging variables are forwarded without requiring users to
customize env-regex.

Changes

  • src/input.ts — default regex: LOG_LEVELLOG_\w+
  • action.yml — updated description of the default value
  • README.md — updated the env-regex example

Motivation

When using LOG_FILE with docker-volumes: /tmp:/tmp to write Renovate
logs and upload them as artifacts, the log file is never created because
LOG_FILE is silently dropped by the action's env filtering.

Example workflow that fails without this change:

- name: Self-hosted Renovate
  uses: renovatebot/github-action@v46.1.14
  with:
    configurationFile: .github/renovate-global.json5
    token: ${{ steps.app-token.outputs.token }}
    docker-volumes: /tmp:/tmp
  env:
    LOG_FILE: /tmp/renovate-log.json

- name: Upload Renovate log
  if: always()
  uses: actions/upload-artifact@v4
  with:
    name: renovate-log
    path: /tmp/renovate-log.json

The workaround today is to specify a custom env-regex that includes
LOG_FILE, but this is non-obvious and error-prone since users expect
logging variables to work the same way LOG_LEVEL does.

Renovate supports several logging-related environment variables
(LOG_FILE, LOG_FILE_FORMAT, LOG_FILE_LEVEL, LOG_FORMAT, LOG_LEVEL,
LOG_CONTEXT) that are loaded before configuration parsing. Previously,
only LOG_LEVEL was forwarded to the Docker container by the default
env-regex pattern.

This change broadens the pattern from LOG_LEVEL to LOG_\w+ so that all
Renovate logging variables (such as LOG_FILE for enabling file logging)
are passed through without requiring users to override env-regex.

@viceice viceice left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use RENOVATE_LOG_ prefix for log variables

@jamietanna @secustor I think we discussed already to change the docs. maybe forgot to do that?

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.

2 participants