fix(action): Uploading artifacts is optional #367
Closed
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.
The check for 'upload_artifacts' is not toggleable as intended, this change adds comparing the string against 'true' for it to upload
Tests (Pay attention to the upload_artifacts input, as well as the repository location of the action:
Testing trying to toggle off artifact uploading (it still uploads): https://github.com/CallumHYoung/security/actions/runs/18741295611/workflow
Setting the repository variable UPLOAD_ARTIFACTS as false: (still uploads):
https://github.com/CallumHYoung/security/actions/runs/18741421117/job/53458444124
Tested without the input (no longer uploads): https://github.com/CallumHYoung/security/actions/runs/18741087822/workflow
Tested with
vars.UPLOAD_ARTIFACTSpassed from the workflow but not set (no longer uploads): https://github.com/CallumHYoung/security/actions/runs/18740724625/workflowTested with upload_artifacts set to 'true' (uploads): https://github.com/CallumHYoung/security/actions/runs/18740858893/workflow
Tested with upload_artifacts set to 'false' (no longer uploads): https://github.com/CallumHYoung/security/actions/runs/18740427308/workflow
I've also tested this with setting the repository variable to false/true and it also works (this example is set to true and it uploads artifacts):
https://github.com/CallumHYoung/security/actions/runs/18741524575/job/53458772968