bacongobbler / azure-blob-storage-upload

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

Dynamic destination path depending on source path #37

Open itaihay opened 1 month ago

itaihay commented 1 month ago

I'm looking to set a destination path that's dynamic to my source path. I can set manual rules for each parent folder name, but I want to keep it dynamic.

Example:

git repo:

configs
    folder1
        file1.json
        file2.json

    folder2
        file1.json

Would result in:

azure:

configs
    folder1
        file1.json
        file2.json

    folder2
        file1.json
bacongobbler commented 1 month ago

I'm not sure I fully follow the question. Can you please demonstrate your issue more clearly? I don't understand what you mean by the destination being "dynamic" in relation to your source path. The git repo and azure directory structures are identical in your example. To replicate that example, you would specify a source_path as the current directory after invoking actions/checkout.

name: Upload To Azure Blob Storage
on:
  push:
    branches:
      - main
jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: bacongobbler/azure-blob-storage-upload@main
        with:
          source_dir: .
          container_name: mycontainer
          connection_string: ${{ secrets.ConnectionString }}

If you want to change the destination path, pass --destination-path in the extra_args field.