I was able to fix this issue and I think I know what’s going on.
In my original dynamic matrix I had group index and group files. The way my workflow was configured, the files were always shuffled before using
set-output… so even if I had the same number of groups they would refer to a different set of files. I think this is what caused the duplicates to appear.
The fix was to separate them into two dynamic matrixes. I use the group index matrix as the matrix for my dependent jobs. Then I would set the group files matrix (which is a json string) as an environment variable. Finally, I use jq and the group index to pluck out the correct group files.
Hope that makes sense.