Skip to content

fix: pass variable as a name#24

Closed
Michał Tomaszek (mtweeman) wants to merge 1 commit intocloudposse:mainfrom
RTBHOUSE:fix/pass-var-name
Closed

fix: pass variable as a name#24
Michał Tomaszek (mtweeman) wants to merge 1 commit intocloudposse:mainfrom
RTBHOUSE:fix/pass-var-name

Conversation

@mtweeman
Copy link
Copy Markdown
Contributor

what

Passing variable name instead of null-label normalized ID.

why

Normalized null-label ID doesn't allow IDs including dot character. Effectively, it tries to change repository name like .github -> github.

@mergify mergify Bot added the triage Needs triage label Apr 14, 2026
@goruha
Copy link
Copy Markdown
Member

Michał Tomaszek (@mtweeman) there is variable for null-label regex_replace_chars defaults to /[^-a-zA-Z0-9]/
This is the way we should solve that problem.

Could you pls try regex_replace_chars this with /[^.-a-zA-Z0-9]/

@goruha Igor Rodionov (goruha) marked this pull request as draft April 14, 2026 16:03
@mtweeman
Copy link
Copy Markdown
Contributor Author

Michał Tomaszek (mtweeman) commented Apr 14, 2026

Michał Tomaszek (@mtweeman) there is variable for null-label regex_replace_chars defaults to /[^-a-zA-Z0-9]/ This is the way we should solve that problem.

Could you pls try regex_replace_chars this with /[^.-a-zA-Z0-9]/

Igor Rodionov (@goruha), actually, I use this module via component. It passes var.repository.name. There's nothing I can do with that I guess from component side?

@goruha
Copy link
Copy Markdown
Member

Michał Tomaszek (@mtweeman) let's then make the fix in the component. We can set the regexp as a hardcoded value to allow dots in the name

@mtweeman
Copy link
Copy Markdown
Contributor Author

Igor Rodionov (@goruha), so this PR is fine and there should be some adjustment in the component only? Where exactly? I'm not that heavy user of null-label to know what's the best place to hard-code that.

@goruha
Copy link
Copy Markdown
Member

Michał Tomaszek (@mtweeman) no. We do not need the PR to solve the problem in the component.
Could you try this component version cloudposse-terraform-components/aws-github-repository#43 ?

@mtweeman
Copy link
Copy Markdown
Contributor Author

Igor Rodionov (@goruha), gotcha, I forgot that context variables can be passed from component, too.
I tested that and it still results in repository = ".github" -> "." # forces replacement
I believe that regex needs to be replaced for "/[^a-zA-Z0-9-.]/"

@mergify mergify Bot removed the triage Needs triage label Apr 21, 2026
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