Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a "mask" param to hide secrets from http_url #26

Merged
merged 5 commits into from
May 26, 2021
Merged

Conversation

irealva
Copy link
Contributor

@irealva irealva commented May 26, 2021

Adds the ability to mask the http_url string to hide secrets with an optional mask 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 use getInput 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 between getInput and getBooleanInput .

This solution might not be the most elegant but it provides flexibility.

@irealva irealva requested review from idan and Wattenberger and removed request for idan May 26, 2021 18:13
@irealva irealva requested a review from mattrothenberg May 26, 2021 18:30
@irealva irealva merged commit eeddd09 into main May 26, 2021
@irealva irealva deleted the secrets-mask branch May 26, 2021 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants