From eae666fc01414a9d094c452004fe3b255b5f6603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Juan=20G=C3=B3mez=20Pe=C3=B1alver?= Date: Wed, 10 Jun 2020 08:54:13 +0100 Subject: [PATCH] Add flags argumen to allow modifiers on the cp command (#3) --- .github/workflows/main.yml | 8 +++++++- action.yml | 5 +++++ entrypoint.sh | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd4d70a..61c045a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,4 +10,10 @@ jobs: uses: canastro/copy-file-action@master with: source: "tests/a.txt" - target: "test-a.txt" \ No newline at end of file + target: "test-a.txt" + - name: copy file with args + uses: canastro/copy-file-action@master + with: + source: "tests/a.txt" + target: "test-a.txt" + flags: "-f" diff --git a/action.yml b/action.yml index 7e2c158..9f1a201 100644 --- a/action.yml +++ b/action.yml @@ -2,6 +2,10 @@ name: 'Copy file' description: 'Copy local files' author: 'Ricardo Canastro' inputs: + flags: + description: 'Flags to use on the cp command. See "man cp" or "cp --help" for more details' + required: false + default: '' source: description: 'Source file' required: true @@ -12,6 +16,7 @@ runs: using: 'docker' image: 'Dockerfile' args: + - ${{inputs.flags}} - ${{inputs.source}} - ${{inputs.target}} branding: diff --git a/entrypoint.sh b/entrypoint.sh index 358be33..495dc4f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,3 @@ #!/bin/sh -l -cp $1 $2 \ No newline at end of file +cp $1 $2 $3 \ No newline at end of file