From 2b9217ef021031a83961fffec4c782927b9c639e Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Thu, 5 Jun 2025 04:17:33 -0400 Subject: [PATCH] Update action.yml --- action.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 58b369f..3f48da2 100644 --- a/action.yml +++ b/action.yml @@ -1,10 +1,7 @@ name: 'pack' description: 'Use pack to upload a package' inputs: - name: - description: 'the name of the upload' - required: true - filename: + file: description: 'the file to upload' required: true feature: @@ -13,18 +10,28 @@ inputs: secret: description: 'the secret for pack' required: true - extract: - description: 'whether to extract the file in to a folder' + prefix: + description: 'an optional prefix for the filename' + required: false + default: '' + is_folder: + description: 'specify as "true" if uploading a folder' required: false default: false runs: - using: "composite" + using: 'composite' steps: + - run: if [ ${{ inputs.is_folder }} == true ] && [ ! -d ${{ inputs.file }} ]; then echo "Not a folder!"; exit 1; fi + - run: if [ ${{ inputs.is_folder }} == false ] && [ ! -f ${{ inputs.file }} ]; then echo "Not a file!"; exit 1; fi - run: echo "Uploading '${{ inputs.filename }} to '${{ vars.PACK_HOST }}/api/upload/${{ gitea.repository }}/${{ inputs.feature }}'" - name: 'Upload file' run: | curl -v -H 'Authorization: Bearer ${{ inputs.secret }}' \ - -F name='${{ inputs.name }}' -F file=${{ inputs.filename }} \ - -F data=@${{ inputs.filename }} \ + -F ref='${{ gitea.ref }}' \ + -F sha='${{ gitea.sha }}' \ + -F prefix='${{ inputs.prefix }}' \ + -F filename='${{ inputs.file }}' \ + -F data=@'${{ inputs.file }}' \ + -F is_folder='${{ inputs.is_folder }}' \ ${{ vars.PACK_HOST }}/api/upload/${{ gitea.repository }}/${{ inputs.feature }} - run: echo "Upload complete" \ No newline at end of file