Skip to content

Commit 7129ea1

Browse files
Mateusz Czeladkaclaude
andcommitted
fix: read Docker component versions from .env.docker-compose instead of .env
Problem: - Pre-release builds were failing with "invalid tag" error - Action expected .env file in root which doesn't exist - When .env was missing, script exited silently (exit 0) but outputs were unset - This caused Docker tags to be empty (e.g., "cardano-node:") causing build failures Solution: - Changed action to read from .env.docker-compose (which exists and contains all needed variables) - Changed exit 0 to exit 1 for fail-fast behavior - Added error messages when variables are not found - Added debug output showing found values This fixes the issue introduced in commit b9f1b04 where versions were separated for cardano-node, postgres, and mithril in DockerHub, but the action wasn't updated to read from the correct source file. Variables now correctly read from .env.docker-compose: - CARDANO_NODE_VERSION=10.5.1 - PG_VERSION_TAG=REL_14_11 - MITHRIL_VERSION=2537.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 773d14c commit 7129ea1

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

.github/actions/build_docker_images/action.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,44 +29,50 @@ secrets:
2929
runs:
3030
using: composite
3131
steps:
32-
- name: Read versions from .env
32+
- name: Read versions from .env.docker-compose
3333
id: envver
3434
shell: bash
3535
run: |
3636
NODE_KEY='${{ inputs.node_version_key }}'
3737
PG_KEY='${{ inputs.pg_version_key }}'
3838
MITHRIL_KEY='${{ inputs.mithril_version_key }}'
3939
40-
if [[ ! -f .env ]]; then
41-
echo ".env not found"
42-
exit 0
40+
if [[ ! -f .env.docker-compose ]]; then
41+
echo ".env.docker-compose not found"
42+
exit 1
4343
fi
4444
4545
get_val() {
4646
local key="$1"
47-
grep -E "^${key}=" .env | head -1 | cut -d= -f2- | tr -d '\r'
47+
grep -E "^${key}=" .env.docker-compose | head -1 | cut -d= -f2- | tr -d '\r'
4848
}
4949
5050
NODE_VAL="$(get_val "$NODE_KEY")"
5151
PG_VAL="$(get_val "$PG_KEY")"
5252
MITHRIL_VAL="$(get_val "$MITHRIL_KEY")"
53-
53+
5454
if [[ -n "$NODE_VAL" ]]; then
5555
echo "node_version=$NODE_VAL" >> "$GITHUB_OUTPUT"
56+
echo "Found $NODE_KEY=$NODE_VAL"
5657
else
57-
echo "No value for $NODE_KEY in .env"
58+
echo "ERROR: No value for $NODE_KEY in .env.docker-compose"
59+
exit 1
5860
fi
5961
6062
if [[ -n "$PG_VAL" ]]; then
6163
echo "pg_version=$PG_VAL" >> "$GITHUB_OUTPUT"
64+
echo "Found $PG_KEY=$PG_VAL"
6265
else
63-
echo "No value for $PG_KEY in .env"
66+
echo "ERROR: No value for $PG_KEY in .env.docker-compose"
67+
exit 1
6468
fi
6569
6670
if [[ -n "$MITHRIL_VAL" ]]; then
6771
echo "mithril_version=$MITHRIL_VAL" >> "$GITHUB_OUTPUT"
72+
echo "Found $MITHRIL_KEY=$MITHRIL_VAL"
6873
else
69-
echo "No value for $MITHRIL_KEY in .env"
74+
echo "ERROR: No value for $MITHRIL_KEY in .env.docker-compose"
75+
exit 1
7076
fi
7177
7278
- name: API - Build and push Docker ${{ inputs.tag }} image

0 commit comments

Comments
 (0)