diff --git a/Dockerfile b/Dockerfile index 6aec947..8eb01d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,9 @@ LABEL "com.github.actions.name"="azure-fileshare-upload" LABEL "com.github.actions.description"="Uploads folders to Azure File Share" LABEL "com.github.actions.icon"="arrow-up" LABEL "com.github.actions.color"="green" -LABEL "repository"="https://github.com/cahaseler/azure-fileshare-upload" -LABEL "homepage"="https://github.com/cahaseler/azure-fileshare-upload" -LABEL "maintainer"="Craig Haseler " +LABEL "repository"="https://github.com/ vanyae-cqc /azure-fileshare-upload" +LABEL "homepage"="https://github.com/ vanyae-cqc /azure-fileshare-upload" +LABEL "maintainer"="Vanya Eccles " ADD entrypoint.sh /entrypoint.sh RUN chmod +x entrypoint.sh diff --git a/README.md b/README.md index c5075a4..d625780 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This action uses the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) to upload a directory of your choice to your Azure File Storage. +It is a fork of https://github.com/cahaseler/azure-fileshare-upload. + ## Usage ### Example @@ -19,11 +21,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: cahaseler/azure-fileshare-upload@v1.0.0 + - uses: vanyae-cqc/azure-fileshare-upload@v1.0.0 with: account_name: storageaccount account_key: ${{secrets.ACCOUNT_KEY}} share_name: azure-fileshare source_dir: config + destination_path: '/my_fileshare_directory' cloud: AzureUSGovernment ``` diff --git a/action.yml b/action.yml index 550b67a..8e856f4 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,9 @@ inputs: source_dir: description: "The name of the directory in your Github you want to replace the contents of the fileshare with." required: true + desination_path: + description: "The destination path in the fileshare to upload to." + required: true cloud: description: "If not on the general cloud, use this to specify an alternate cloud such as AzureUSGovernment." required: false diff --git a/entrypoint.sh b/entrypoint.sh index a944a96..6ebbe12 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,9 +22,16 @@ if [ -z "$INPUT_SOURCE_DIR" ]; then exit 1 fi +if [ -z "$INPUT_DESTINATION_PATH" ]; then + echo "Destination path is not set. Quitting." + exit 1 +fi + if [ -n "$INPUT_CLOUD" ]; then echo "Setting Azure Cloud to $INPUT_CLOUD" az cloud set --name $INPUT_CLOUD fi -az storage file upload-batch --account-name $INPUT_ACCOUNT_NAME --account-key $INPUT_ACCOUNT_KEY --destination $INPUT_SHARE_NAME --source $INPUT_SOURCE_DIR + + +az storage file upload-batch --account-name $INPUT_ACCOUNT_NAME --account-key $INPUT_ACCOUNT_KEY --destination $INPUT_SHARE_NAME --destination-path $INPUT_DESTINATION_PATH --source $INPUT_SOURCE_DIR