feat: add a "mask" param to hide secrets from http_url #26
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.
Adds the ability to mask the
http_url
string to hide secrets with an optionalmask
parameter. This problem was reported in this discussion.Provides a way to do so with two options:
Option 1: use a string boolean
mask: true # removes the source entirely from the commit message, defaults to false
Option 2: use a string array with each secret to mask
mask: '["${{ secrets.SECRET1 }}", "${{ secrets.SECRET2 }}"]'
What I tried before landing on this solution:
The
zod
library for configuring the yaml schema provides support for different types of inputs doing something like:z.union([z.string(), z.boolean()])
. So I initially tried to support both types of inputs. The problem is that we usegetInput
on the action and it always returns a string. We'd have to know "a priori" whether a user is inputting a boolean or string type which doesn't seem possible in order to choose betweengetInput
andgetBooleanInput
.This solution might not be the most elegant but it provides flexibility.