Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-actions/fetch: Add path arg #908

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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