feat: Add support for running inside a matrix by overriding the default correlator
identifier
#50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for running the action inside a matrix by enhancing the correlator functionality, updates the action's input configuration, and modifies the main script to utilize the new correlator input.
Inspiration: wanted to loop through all SBOM samples in spdx sample repo via dependency_submission.yml but noticed all the correlators were taking the name of my job only (not the name of the job+matrix instance).
Matrix Support and Correlator Enhancements:
README.md
: Added instructions for defining a correlator that includes job and matrix values, and provided a sample YAML configuration for SBOM upload. (View rendered markdown)action.yml
: Introduced a new inputcorrelator
with a description and default value set to${{ github.job }}
.index.js
: Modified thecorrelator
property in theSnapshot
object to use the value from the newcorrelator
input instead of the default${github.context.job}
.Before:
job
only:After: support for
job(matrixValue1, matrixValue2, ...)
:Sample
Using sample provided in readme, can have the correlator match the action job naming: