Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle weird input paths by passing as env var
  • Loading branch information
Kyle Lacy committed Aug 27, 2022
1 parent fb03cce commit 70a1409
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions action.yml
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 70a1409

Please sign in to comment.