From 70a14093be814b91093aeb487d38f3d6da2eaee2 Mon Sep 17 00:00:00 2001 From: Kyle Lacy Date: Sat, 27 Aug 2022 12:42:58 -0700 Subject: [PATCH 1/2] Handle weird input paths by passing as env var --- action.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 13862be..ff396d7 100644 --- a/action.yml +++ b/action.yml @@ -19,11 +19,14 @@ runs: run: | tar \ --dereference --hard-dereference \ - --directory ${{ inputs.path }} \ - -cvf ${{ runner.temp }}/artifact.tar \ + --directory "$INPUT_PATH" \ + -cvf "$RUNNER_TEMP/artifact.tar" \ --exclude=.git \ --exclude=.github \ . + env: + INPUT_PATH: ${{ inputs.path }} + RUNNER_TEMP: ${{ runner.temp }} # Switch to gtar (GNU tar instead of bsdtar which is the default in the MacOS runners so we can use --hard-dereference) - name: Archive artifact @@ -32,11 +35,14 @@ runs: run: | gtar \ --dereference --hard-dereference \ - --directory ${{ inputs.path }} \ - -cvf ${{ runner.temp }}/artifact.tar \ + --directory "$INPUT_PATH" \ + -cvf "$RUNNER_TEMP/artifact.tar" \ --exclude=.git \ --exclude=.github \ . + env: + INPUT_PATH: ${{ inputs.path }} + RUNNER_TEMP: ${{ runner.temp }} # Massage the paths for Windows only - name: Archive artifact @@ -45,12 +51,15 @@ runs: run: | tar \ --dereference --hard-dereference \ - --directory "${{ inputs.path }}" \ - -cvf "${{ runner.temp }}\artifact.tar" \ + --directory "$INPUT_PATH" \ + -cvf "$RUNNER_TEMP\artifact.tar" \ --exclude=.git \ --exclude=.github \ --force-local \ "." + env: + INPUT_PATH: ${{ inputs.path }} + RUNNER_TEMP: ${{ runner.temp }} - name: Upload artifact uses: actions/upload-artifact@main From fa880244ea08e3db8d86034fc4ecef66127fdf86 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 2 Sep 2022 17:14:45 -0500 Subject: [PATCH 2/2] Remove redundant environment variable --- action.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/action.yml b/action.yml index ff396d7..2f162b8 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,6 @@ runs: . env: INPUT_PATH: ${{ inputs.path }} - RUNNER_TEMP: ${{ runner.temp }} # Switch to gtar (GNU tar instead of bsdtar which is the default in the MacOS runners so we can use --hard-dereference) - name: Archive artifact @@ -42,7 +41,6 @@ runs: . env: INPUT_PATH: ${{ inputs.path }} - RUNNER_TEMP: ${{ runner.temp }} # Massage the paths for Windows only - name: Archive artifact @@ -59,7 +57,6 @@ runs: "." env: INPUT_PATH: ${{ inputs.path }} - RUNNER_TEMP: ${{ runner.temp }} - name: Upload artifact uses: actions/upload-artifact@main