Can I update the build matrix inside the action?

Hi,
Is there a way to make a different job for every subfolder I have in the repo.
assuming I have folder1-5
I currently am doing this manually, I update the yaml with the folder names

jobs:
 build:
   runs-on: ubuntu-latest
   strategy:
     matrix:
       folders: [folder1, folder2, folder3, folder4, folder5]
...
# then per run I use the folder
run: |
       pip install -r ${{ matrix.folders }}/requirements.txt

But is there any way to have it automatically without having to manually update the values inside folders every time or maybe to have the value of folders be updated by another action (update the list of subfolders)
Thanks

Hi @shonigs,

You have to create a job that would, collect all the directory names into a JSON output, that you would then use as your matrix in the subsequent job.