Skip to content

Sanitize role-session-name input #1656

@int128

Description

@int128

Describe the feature

It would be nice if role-session-name input is sanitized and passed to STS API.

Use Case

When I set a repository name or actor to role-session-name, STS API returns the error: Member must satisfy regular expression pattern: [\w+=,.@-]*. For example,

    - uses: aws-actions/configure-aws-credentials@v6
      with:
        aws-region: us-east-2
        role-to-assume: arn:aws:iam::987654321000:role/my-second-role
        role-session-name: GitHubActions--${github.repository}--${github.actor}

I need to sanitize it using some script like:

    - run: echo "value=GitHubActions--${GITHUB_REPOSITORY}--${GITHUB_ACTOR}" | sed -E 's/[^a-zA-Z0-9+=,.@-]/_/g' >> "$GITHUB_OUTPUT"

Proposed Solution

I think the role session name can be sanitized before sending a request:

RoleSessionName: roleSessionName,

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions