Skip to content

Commit

Permalink
gh-actions/fetch: Add path arg (#908)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <ryan@synca.io>
  • Loading branch information
phlax authored Oct 28, 2023
1 parent 0d8b6ca commit 7589d5c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions gh-actions/fetch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ inputs:
url:
type: string
required: true
path:
type: string

outputs:
path:
Expand All @@ -12,9 +14,13 @@ runs:
using: "composite"
steps:
- run: |
echo "FETCH ${{ inputs.url }}"
tmpdir=$(mktemp -d)
cd "$tmpdir"
if [[ -n "${{ inputs.path }}" ]]; then
path="${{ inputs.path }}"
else
path=$(mktemp -d)
fi
mkdir -p "$path"
cd "$path"
curl -sLO "${{ inputs.url }}"
filepath="$(realpath "$(basename "${{ inputs.url }}")")"
echo "path=${filepath}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 7589d5c

Please sign in to comment.