fix: handle null Env in Portainer stack redeploy #21

Merged
elvis merged 1 commit from feat/cicd_improvements into main 2026-05-28 17:58:16 +00:00
Owner

Summary

  • '.Env // []' — Portainer returns null for Env when no env vars are set via the UI; defaulting to [] fixes the --argjson invalid JSON error
  • Renamed ENVSTACK_ENVENV is a reserved shell variable in sh, which can cause subtle interference
  • Added set -e so the script stops on first failure instead of printing a false success message
  • Added curl -f so HTTP errors from Portainer are treated as failures

Test plan

  • Merge to main → confirm the full "Build and Push" workflow completes without errors, including the redeploy step

🤖 Generated with Claude Code

## Summary - `'.Env // []'` — Portainer returns `null` for `Env` when no env vars are set via the UI; defaulting to `[]` fixes the `--argjson invalid JSON` error - Renamed `ENV` → `STACK_ENV` — `ENV` is a reserved shell variable in sh, which can cause subtle interference - Added `set -e` so the script stops on first failure instead of printing a false success message - Added `curl -f` so HTTP errors from Portainer are treated as failures ## Test plan - [ ] Merge to main → confirm the full "Build and Push" workflow completes without errors, including the redeploy step 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix: handle null Env in Portainer stack redeploy
Some checks failed
Test / test (pull_request) Failing after 3s
954f541209
- Default .Env to [] when null to avoid --argjson invalid JSON error
- Rename ENV to STACK_ENV to avoid conflict with reserved shell variable
- Add set -e so script fails fast instead of printing false success
- Add curl -f to fail on HTTP errors from Portainer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
elvis merged commit efbe21bd85 into main 2026-05-28 17:58:16 +00:00
elvis deleted branch feat/cicd_improvements 2026-05-28 17:58:16 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
elvis/actual-mcp!21
No description provided.