Skip to content

Commit 5630c7d

Browse files
committed
ci: fix TMPDIR override, set -e exit capture, redundant glob
- Rename TMPDIR to BUILD_DIR to avoid clobbering POSIX env var - Use 'cmd && RC=0 || RC=$?' pattern so set -e doesn't skip cleanup - Remove redundant CONTRIBUTING.md from docs-only case patterns (*.md covers it)
1 parent 7601b5c commit 5630c7d

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.github/workflows/install-smoke.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
while IFS= read -r path; do
4444
[ -z "$path" ] && continue
4545
case "$path" in
46-
docs/*|*.md|*.mdx|LICENSE|CONTRIBUTING.md)
46+
docs/*|*.md|*.mdx|LICENSE)
4747
continue
4848
;;
4949
*)

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
while IFS= read -r path; do
4444
[ -z "$path" ] && continue
4545
case "$path" in
46-
docs/*|*.md|*.mdx|LICENSE|CONTRIBUTING.md)
46+
docs/*|*.md|*.mdx|LICENSE)
4747
continue
4848
;;
4949
*)

bin/ci/install-smoke-docker.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ fi
2525

2626
# ── Build context ────────────────────────────────────────────────────────────
2727

28-
TMPDIR=$(mktemp -d)
29-
trap 'rm -rf "$TMPDIR"' EXIT
28+
BUILD_DIR=$(mktemp -d)
29+
trap 'rm -rf "$BUILD_DIR"' EXIT
3030

3131
# Create tarball excluding unnecessary files
32-
tar czf "$TMPDIR/src.tar.gz" \
32+
tar czf "$BUILD_DIR/src.tar.gz" \
3333
-C "$REPO_DIR" \
3434
--exclude=node_modules \
3535
--exclude=.git \
@@ -39,7 +39,7 @@ tar czf "$TMPDIR/src.tar.gz" \
3939

4040
# ── Dockerfile ───────────────────────────────────────────────────────────────
4141

42-
cat > "$TMPDIR/Dockerfile" <<'DOCKERFILE'
42+
cat > "$BUILD_DIR/Dockerfile" <<'DOCKERFILE'
4343
FROM ubuntu:24.04
4444
4545
ENV DEBIAN_FRONTEND=noninteractive
@@ -80,7 +80,7 @@ DOCKERFILE
8080

8181
# ── Verification script ─────────────────────────────────────────────────────
8282

83-
cat > "$TMPDIR/verify.sh" <<'VERIFY'
83+
cat > "$BUILD_DIR/verify.sh" <<'VERIFY'
8484
#!/bin/bash
8585
set -euo pipefail
8686
@@ -154,12 +154,11 @@ VERIFY
154154
IMAGE_TAG="baudbot-install-smoke:$(date +%s)"
155155

156156
echo "Building Docker image..."
157-
docker build -t "$IMAGE_TAG" "$TMPDIR" 2>&1 | tail -5
157+
docker build -t "$IMAGE_TAG" "$BUILD_DIR" 2>&1 | tail -5
158158

159159
echo ""
160160
echo "Running verification..."
161-
docker run --rm "$IMAGE_TAG" /verify.sh
162-
RC=$?
161+
docker run --rm "$IMAGE_TAG" /verify.sh && RC=0 || RC=$?
163162

164163
# Cleanup image
165164
docker rmi "$IMAGE_TAG" >/dev/null 2>&1 || true

0 commit comments

Comments
 (0)