PREQ-4918: Support unique artifact names for matrix jobs#240
Conversation
SummaryAdds optional What reviewers should knowStart with the action definitions: Review Note on fallback strategy: The PR uses README changes: Verify the documentation updates show clear before/after examples and explain when to use Testing coverage: The PR was tested in a Gradle project with matrix builds (verify the linked workflow run). Consider whether npm matrix scenarios were similarly validated.
|
julien-carsique-sonarsource
left a comment
There was a problem hiding this comment.
Please update the README.
This should be fixed across all the actions, not only here: it's a repeated pattern.
Also, isn't it possible to use a dynamic unique ID, without asking for a parameter.
40f8a83 to
ca45161
Compare
758d076 to
09b99d3
Compare
…k in build-gradle Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…adle and build-npm
09b99d3 to
9a96167
Compare
|




What Changed?
Adds a
job-identifierinput tobuild-gradleandbuild-npmto avoid artifact name collisions in matrix jobs (example 409 error).build-gradlejob-identifier: appended to theproblems-report-<job-identifier>artifact name$RANDOM-based value is generated per job to guarantee uniquenessbuild-npmjob-identifierinput added for thenpm-logs-<job-identifier>artifactWhen to use
job-identifierThe default
$RANDOMfallback is sufficient for most cases. Setjob-identifierexplicitly when you want human-readable artifact names — e.g. when calling from a reusable workflow invoked in a matrix:This produces
problems-report-my-moduleinstead ofproblems-report-<random>.Background
The original hardcoded
github.job + strategy.job-indexnaming collides when the action is called from a reusable workflow that is itself invoked in a matrix —github.jobis always the reusable workflow's fixed job ID there, causing 409 conflicts.