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

Configurable name transformation for environment variables #111

Merged
merged 1 commit into from
May 10, 2024

Conversation

jirkafajfr
Copy link
Member

@jirkafajfr jirkafajfr commented Apr 15, 2024

Issue #67

Description of changes:

The action now has additional parameter called name-transformation. Its allowed options are:

  • uppercase (default): secret names will be transformed into uppercase. This is how this action historically worked, and is default value.
  • lowercase: secret names will be transformed into the lowercase.
  • none: no transformation will be performed on the environment variable names and they'll be kept in the same casing as defined in the secret-ids property.

Example 1

- name: Get secrets
  uses: aws-actions/aws-secretsmanager-get-secrets@v2
  with:
    secret-ids: exampleSecretName
    name-transformation: lowercase

will yield environment variable examplesecretname

Example 2

- name: Get secrets
  uses: aws-actions/aws-secretsmanager-get-secrets@v2
  with:
    secret-ids: exampleSecretName
    name-transformation: none

will yield environment variable exampleSecretName

CI changes

I've split integration tests into several branches where each tests different parameter options.

image

@jirkafajfr jirkafajfr marked this pull request as ready for review April 15, 2024 16:03
@jirkafajfr jirkafajfr requested a review from a team as a code owner April 15, 2024 16:03
src/constants.ts Outdated Show resolved Hide resolved
src/utils.ts Show resolved Hide resolved
Copy link
Contributor

@YuvalShAz YuvalShAz left a comment

Choose a reason for hiding this comment

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

nit: If we want to cover all the bases with the integ tests it could be useful to add edge cases like blank aliases as well (shouldn't affect the correct-ness of this PR)

@jirkafajfr jirkafajfr dismissed simonmarty’s stale review May 10, 2024 18:58

Explanation around parseTransformationFunction nullability provided.

@jirkafajfr jirkafajfr merged commit ff26a0a into main May 10, 2024
6 checks passed
@jirkafajfr jirkafajfr deleted the feature/name-transformation branch May 10, 2024 18:59
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.

None yet

4 participants