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

Added option to convert secrets to base64 #303

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

danilokorber
Copy link

Converts all exported secrets to a base64 string (default is false):

steps:
- uses: actions/checkout@v3
- uses: oNaiPs/secrets-to-env-action@v1
  with:
    secrets: ${{ toJSON(secrets) }}
    value_as_base64: true
- run: echo "Value of my_secret: $my_secret"

If value_as_base64 is true, the value of the secret will be converted to a base64 string.

@danilokorber danilokorber requested a review from oNaiPs as a code owner March 12, 2024 11:56
Copy link
Owner

@oNaiPs oNaiPs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danilokorber thanks for the PR.
Since we already have an attribute convert that allows you to convert the inputs, let's use convert: base64 instead to achieve your goal?
Thanks

src/main.ts Outdated Show resolved Hide resolved
@danilokorber
Copy link
Author

danilokorber commented Mar 12, 2024

@danilokorber thanks for the PR. Since we already have an attribute convert that allows you to convert the inputs, let's use convert: base64 instead to achieve your goal? Thanks

Hey @oNaiPs
I thought of using the convert attribute, but I thought this could be confusing, since convert is used to change the key and this PR is to change the value. Additionally, this allows us to change the key to the desired form AND the value to base64.

Please let me know if you still want to use the convert option for this. What we also can do, is change the option to convert_value and accept base64 as value. This would prepare the action to other conversion types in the future.

@danilokorber danilokorber requested a review from oNaiPs March 15, 2024 06:15
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