Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Fixes #5

Merged
merged 6 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/test-zip-upload-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jobs:
test-zip-upload-artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Create Test Files
shell: python
run: |
Expand All @@ -32,23 +35,23 @@ jobs:

- name: Test Directory With Files
if: always()
uses: im-open/zip-upload-artifact@main
uses: action.yml
with:
name: Directory With Text Files
path: test_results
retention-days: '3'

- name: Test Single File in a Directory
if: always()
uses: im-open/zip-upload-artifact@main
uses: action.yml
with:
name: Single Text File in Directory
path: test_results/file_1.txt
retention-days: '3'

- name: Test Single File at Root Directory
if: always()
uses: im-open/zip-upload-artifact@main
uses: action.yml
with:
name: Single Test File at Root Directory
path: file_0.txt
Expand Down
17 changes: 14 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runs:
using: 'composite'
steps:
- name: Determine if Path is a File or Directory
id: validate_inputs
id: validation
shell: python
run: |
import os
Expand Down Expand Up @@ -69,17 +69,28 @@ runs:
INPUT_NAME: ${{ inputs.name }}
INPUT_PATH: ${{ inputs.path }}

- name: Show validation outputs
shell: bash
run: |
echo "Show validation outputs that have been set in the validation step..."
echo "LOOKUP_PATH: $LOOKUP_PATH"
echo "DESTINATION_PATH: $DESTINATION_PATH"
echo ""
env:
LOOKUP_PATH: ${{ steps.validation.outputs.LOOKUP_PATH }}
DESTINATION_PATH: ${{ steps.validation.outputs.DESTINATION_PATH }}

- name: Zip Artifact
shell: pwsh
run: |
echo "Zipping Artifact File..."
Compress-Archive -Path ./${{ steps.validate_inputs.outputs.LOOKUP_PATH }} -DestinationPath "./${{ steps.validate_inputs.outputs.DESTINATION_PATH }}"
Compress-Archive -Path ./${{ steps.validation.outputs.LOOKUP_PATH }} -DestinationPath "./${{ steps.validation.outputs.DESTINATION_PATH }}"
echo "DONE!"

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.name }}
path: ${{ steps.validate_inputs.outputs.DESTINATION_PATH }}
path: ${{ steps.validation.outputs.DESTINATION_PATH }}
if-no-files-found: ${{ inputs.if-no-files-found }}
retention-days: ${{ inputs.retention-days }}
Loading