Skip to content

Commit 1230e37

Browse files
committed
fix(pipe): remove jq from Dockerfile and improve stash handling in pipe.sh
1 parent 5481848 commit 1230e37

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENV SECRET_KEY=$SECRET_KEY
66
VOLUME /repo
77
WORKDIR /repo
88

9-
RUN apk add --update --no-cache bash git git-crypt jq
9+
RUN apk add --update --no-cache bash git git-crypt
1010
COPY pipe.sh /
1111

1212
ENTRYPOINT ["/pipe.sh"]

pipe.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/sh
22

3-
cat package.json | jq .version
4-
53
# Check for the presence of the SECRETS_KEY environment variable
64
if [ -z "$SECRETS_KEY" ]; then
75
echo "SECRETS_KEY environment variable is missing."
@@ -15,6 +13,7 @@ git config --global --add safe.directory ${PWD}
1513
if [ $GIT_STASH = "true" ]; then
1614
echo "Stashing changes"
1715
git stash
16+
1817
fi
1918

2019
echo "$SECRETS_KEY" | base64 -d > /tmp/secrets.key
@@ -24,7 +23,7 @@ git-crypt unlock /tmp/secrets.key
2423
rm -f /tmp/secrets.key
2524
echo "Decrypted git-crypt files"
2625

27-
if [ $GIT_STASH = "true" ]; then
28-
echo "Applying stash"
29-
git stash apply
30-
fi
26+
if [ "$GIT_STASH" = "true" ] && [ "$(git stash list | wc -l)" -gt 0 ]; then
27+
echo "Applying stashed changes"
28+
git stash pop
29+
fi

0 commit comments

Comments
 (0)