Update action.yml
This commit is contained in:
parent
c66ccdfda5
commit
c225fdf980
20
action.yml
20
action.yml
@ -23,9 +23,22 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- run: if [ ${{ inputs.is_folder }} == true ] && [ ! -d ${{ inputs.file }} ]; then echo "Not a folder!"; exit 1; fi
|
- 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: if [ ${{ inputs.is_folder }} == false ] && [ ! -f ${{ inputs.file }} ]; then echo "Not a file!"; exit 1; fi
|
||||||
- run: echo "Uploading '${{ inputs.file }}' to '${{ vars.PACK_HOST }}/api/upload/${{ gitea.repository }}/${{ inputs.feature }}'"
|
- run: |
|
||||||
- name: 'Upload file'
|
if [ ${{ inputs.is_folder }} == true ]; then \
|
||||||
run: |
|
echo "Packaging folder..." &&
|
||||||
|
cd ${{ inputs.file }} &&
|
||||||
|
tar -czf file.tgz * &&
|
||||||
|
echo "Uploading '${{ inputs.file }}' to '${{ vars.PACK_HOST }}/api/upload/${{ gitea.repository }}/${{ inputs.feature }}'" &&
|
||||||
|
curl -v -H 'Authorization: Bearer ${{ inputs.secret }}' \
|
||||||
|
-F sha=${{ gitea.sha }} \
|
||||||
|
-F ref='${{ gitea.ref }}' \
|
||||||
|
-F prefix='${{ inputs.prefix }}' \
|
||||||
|
-F filename=file.tgz \
|
||||||
|
-F data=@file.tgz \
|
||||||
|
-F is_folder='${{ inputs.is_folder }}' \
|
||||||
|
${{ vars.PACK_HOST }}/api/upload/${{ gitea.repository }}/${{ inputs.feature }}
|
||||||
|
else
|
||||||
|
echo "Uploading '${{ inputs.file }}' to '${{ vars.PACK_HOST }}/api/upload/${{ gitea.repository }}/${{ inputs.feature }}'" &&
|
||||||
curl -v -H 'Authorization: Bearer ${{ inputs.secret }}' \
|
curl -v -H 'Authorization: Bearer ${{ inputs.secret }}' \
|
||||||
-F sha=${{ gitea.sha }} \
|
-F sha=${{ gitea.sha }} \
|
||||||
-F ref='${{ gitea.ref }}' \
|
-F ref='${{ gitea.ref }}' \
|
||||||
@ -34,4 +47,5 @@ runs:
|
|||||||
-F data=@'${{ inputs.file }}' \
|
-F data=@'${{ inputs.file }}' \
|
||||||
-F is_folder='${{ inputs.is_folder }}' \
|
-F is_folder='${{ inputs.is_folder }}' \
|
||||||
${{ vars.PACK_HOST }}/api/upload/${{ gitea.repository }}/${{ inputs.feature }}
|
${{ vars.PACK_HOST }}/api/upload/${{ gitea.repository }}/${{ inputs.feature }}
|
||||||
|
fi
|
||||||
- run: echo "Upload complete"
|
- run: echo "Upload complete"
|
||||||
Loading…
x
Reference in New Issue
Block a user