This repository was archived by the owner on Feb 15, 2026. It is now read-only.
fix(ci): handle grep exit code 1 when .env contains only comments#43
Merged
fix(ci): handle grep exit code 1 when .env contains only comments#43
Conversation
The _export_unset function was failing in CI because grep -v '^#' returns exit code 1 when no lines match (file contains only comments). With set -o errexit, this caused the script to exit immediately. The CI workflow creates .env with just a comment line: # Environment file for GitHub Actions When _export_unset tries to grep out comments, no lines match, and grep exits with code 1, terminating the script. Fix: Add || true to the grep command to ignore the no-match exit code. Also removed debug statements from the previous commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
_export_unsetfunction failing when.envcontains only commentsRoot Cause
The CI workflow creates
.envwith a single comment line:When
_export_unsetrunsgrep -v '^#'on this file:grepreturns exit code 1 (no matches found)set -o errexit, exit code 1 causes the script to exit immediatelyThis is why the build-deb step was failing in 0.002 seconds right after printing "🗝️ Setting environment from .env and .env.defaults".
Solution
Add
|| trueto the grep command:This allows the command to succeed even when grep finds no matches.
Test plan
🤖 Generated with Claude Code