Skip to content

Commit 3843e22

Browse files
authored
fix: fix output (#41)
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
1 parent eeead82 commit 3843e22

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
66
ARG copa_version
77

88
# Copies your code file from your action repository to the filesystem path `/` of the container
9-
COPY entrypoint.sh /entrypoint.sh
9+
COPY entrypoint.sh /entrypoint.sh
1010

1111
# Install required packages
1212
RUN apt-get update && \

action.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ runs:
5151
connection="buildx"
5252
5353
# check for other methods of connection
54-
if [ -n "{{ inputs.custom-socket }}"]; then
54+
if [ ! -z "${{ inputs.custom-socket }}" ]; then
5555
socket="${{ inputs.custom-socket }}"
5656
connection="custom-socket"
57-
elif [ -n "${{ inputs.buildkit-version }}" ]; then
57+
elif [ ! -z "${{ inputs.buildkit-version }}" ]; then
5858
docker run --net=host --detach --rm --privileged -p 127.0.0.1:8888:8888 --name buildkitd --entrypoint buildkitd moby/buildkit:${{ inputs.buildkit-version }} --addr tcp://0.0.0.0:8888
5959
connection="buildkit-container"
6060
fi
61-
61+
6262
# run copa-action based on inputs
63-
docker run --net=host --mount=type=bind,source=$(pwd),target=/data --mount=type=bind,source="$socket",target="/var/run/docker.sock" --mount=type=bind,source=$GITHUB_OUTPUT,target=$GITHUB_OUTPUT -e GITHUB_OUTPUT --name=copa-action "ghcr.io/project-copacetic/copa-action:v$version" ${{ inputs.image }} ${{ inputs.image-report }} ${{ inputs.patched-tag }} ${{ inputs.timeout }} "$connection" ${{ inputs.format }} {{ inputs.output }}
63+
docker run --net=host --mount=type=bind,source=$(pwd),target=/data --mount=type=bind,source="$socket",target="/var/run/docker.sock" --mount=type=bind,source=$GITHUB_OUTPUT,target=$GITHUB_OUTPUT -e GITHUB_OUTPUT --name=copa-action "ghcr.io/project-copacetic/copa-action:v$version" ${{ inputs.image }} ${{ inputs.image-report }} ${{ inputs.patched-tag }} ${{ inputs.timeout }} ${connection} ${{ inputs.format }} ${{ inputs.output }}

entrypoint.sh

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

33
set -ex;
44

@@ -8,7 +8,7 @@ patched_tag=$3
88
timeout=$4
99
connection_format=$5
1010
format=$6
11-
output_file=$7
11+
output_file=$7
1212

1313
# parse image into image name
1414
image_no_tag=$(echo "$image" | cut -d':' -f1)
@@ -28,15 +28,15 @@ case "$connection_format" in
2828
docker buildx create --name=copa-action
2929
docker buildx use --default copa-action
3030
connection="--addr buildx://copa-action"
31-
;;
31+
;;
3232
# through a running buildkit container over tcp
3333
"buildkit-container")
3434
connection="--addr tcp://127.0.0.1:8888"
35-
;;
35+
;;
3636
# through the default docker buildkit endpoint enabled with a custom socket
3737
"custom-socket")
3838
connection=""
39-
;;
39+
;;
4040
esac
4141

4242
# run copa to patch image

0 commit comments

Comments
 (0)