Skip to content

Unset config-env-vars and config-vars-init-random#46

Merged
lionello merged 3 commits into
mainfrom
lio/hide-env-warning
May 27, 2026
Merged

Unset config-env-vars and config-vars-init-random#46
lionello merged 3 commits into
mainfrom
lio/hide-env-warning

Conversation

@lionello
Copy link
Copy Markdown
Member

@lionello lionello commented May 26, 2026

Unset specific input variables in the action script.

Summary by CodeRabbit

  • Chores
    • Updated environment-variable handling so the Defang command no longer emits warnings about shell-provided configuration being ignored.

Review Change Stack

Unset specific input variables in the action script.
@lionello lionello marked this pull request as ready for review May 26, 2026 23:55
@lionello lionello requested a review from a team as a code owner May 26, 2026 23:55
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bab9b668-e3ae-46ef-8da1-11fb5a65004e

📥 Commits

Reviewing files that changed from the base of the PR and between 4735bce and 39c9a29.

📒 Files selected for processing (1)
  • action.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • action.yaml

📝 Walkthrough

Walkthrough

The composite action exports CONFIG_ENV_VARS and CONFIG_ENV_VARS_INIT_RANDOM into the Defang step and unsets each environment variable name listed in config-env-vars, config-vars-init-random, and dont_complain_on_empty immediately before running the Defang command.

Changes

Environment variable cleanup before command execution

Layer / File(s) Summary
Unset inputs before command execution
action.yaml
Exports CONFIG_ENV_VARS and CONFIG_ENV_VARS_INIT_RANDOM to the step environment and adds a pre-command loop in the "Defang ${{ inputs['command'] }}" step that unsets each variable named by config-env-vars and config-vars-init-random plus dont_complain_on_empty prior to executing the Defang CLI.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hop through the script with a careful paw,
Unsetting names before Defang sees law.
Quiet the warnings, hush the alarm,
Environment tidy, free from harm,
Now the CLI runs serene and calm.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: unsetting config-env-vars and config-vars-init-random variables in the action script to prevent CLI warnings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lio/hide-env-warning

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@action.yaml`:
- Around line 187-188: The unset invocation using the expanded inputs ('${{
inputs['config-env-vars'] }}' and '${{ inputs['config-vars-init-random'] }}') is
unsafe for newline-delimited values and will break if inputs contain embedded
newlines; replace the single unsafe unset call with a loop that iterates over
each variable name (split on newlines) and calls unset on each item individually
(e.g., read the inputs into lines and for each line run unset "$var"), ensuring
you still unset the literal dont_complain_on_empty as well; update the code
around the unset statement to perform per-line safe unsets for the two input
variables referenced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 31166755-8760-4d3e-837f-9c08f5fafa3a

📥 Commits

Reviewing files that changed from the base of the PR and between 482e8e6 and 60e9c3a.

📒 Files selected for processing (1)
  • action.yaml

Comment thread action.yaml Outdated
Comment thread action.yaml Outdated
@lionello lionello merged commit 0be2b9b into main May 27, 2026
5 checks passed
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