bacongobbler / azure-blob-storage-upload

Uploads assets to Azure Blob Storage
Other
54 stars 24 forks source link

Pattern matching outside of source_dir #34

Open oldShatteredHands7 opened 3 months ago

oldShatteredHands7 commented 3 months ago

I am not sure if this is a bug or working as designed.

I have a couple of .tgz in the working directory. Based on the user input selected or all .tgz files are moved into directory ./deploy.

My issue is that the upload will fail if not all .tgz files are moved into ./deploy with error message ERROR: unrecognized arguments: <all .tgz filenames without path> e.g.(ERROR: unrecognized arguments: file1.tgz file2.tgz)

A workaround is to remove the pattern from extra_args.

I don't get any helpful information from the debug logs but I guess that the pattern matching will include files from the parent directory and since these files do not exist in ./deploy the command will fail

My upload configuration is as follows:

- name: Upload To Azure Blob Storage
        uses: bacongobbler/azure-blob-storage-upload@main
        with:
            source_dir: "deploy"
            container_name: apps-test
            sas_token: ${{ secrets.SASToken }}
            account_name : "storage"
            extra_args: '--pattern *.tgz --destination-path searchApps'
            overwrite: 'true'
bacongobbler commented 3 months ago

Is it possible that your terminal is expanding wildcards to all filenames?

Your configuration equates to the following command:

az storage blob upload-batch --source deploy apps-test --sas-token ${{ secrets.SASToken }} --account-name storage --pattern *.tgz --destination-path searchApps --overwrite true

If globstar expansion is enabled in your terminal, it'd expand the wildcard to --pattern file1.tgz file2.tgz file3.tgz, which would not be valid in this context.