From 7ddff6fc153a2ea2cd0fb88ed9750544c051e399 Mon Sep 17 00:00:00 2001 From: canastro Date: Sat, 4 Jan 2020 10:29:34 +0000 Subject: [PATCH] add docker args --- Dockerfile | 8 ++++++-- action.yml | 5 +++++ entrypoint.sh | 7 ++----- 3 files changed, 13 insertions(+), 7 deletions(-) mode change 100644 => 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 123da62..496dba3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,8 @@ +# Container image that runs your code FROM alpine:latest -ADD entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/action.yml b/action.yml index 3f84e67..7e2c158 100644 --- a/action.yml +++ b/action.yml @@ -4,11 +4,16 @@ author: 'Ricardo Canastro' inputs: source: description: 'Source file' + required: true target: description: 'Target file' + required: true runs: using: 'docker' image: 'Dockerfile' + args: + - ${{inputs.source}} + - ${{inputs.target}} branding: icon: 'copy' color: 'green' \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 index a31d73f..358be33 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,3 @@ -#!/bin/bash +#!/bin/sh -l -set -e -set -o pipefail - -sh -c "cp $*" \ No newline at end of file +cp $1 $2 \ No newline at end of file