Skip to content

Commit

Permalink
Merge pull request #19 from kylewlacy/handle-weird-paths
Browse files Browse the repository at this point in the history
Handle weird input paths
  • Loading branch information
JamesMGreene authored Sep 2, 2022
2 parents fb03cce + fa88024 commit a597aec
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ 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 }}

# 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 +34,13 @@ 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 }}

# Massage the paths for Windows only
- name: Archive artifact
Expand All @@ -45,12 +49,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 \
--force-local \
"."
env:
INPUT_PATH: ${{ inputs.path }}

- name: Upload artifact
uses: actions/upload-artifact@main
Expand Down

0 comments on commit a597aec

Please sign in to comment.