Skip to content

fix: pass variable as a name#24

Draft
mtweeman wants to merge 1 commit intocloudposse:mainfrom
RTBHOUSE:fix/pass-var-name
Draft

fix: pass variable as a name#24
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.

@mtweeman mtweeman requested review from a team as code owners April 14, 2026 11:53
@mergify mergify bot added the triage Needs triage label Apr 14, 2026
@goruha
Copy link
Copy Markdown
Member

goruha commented Apr 14, 2026

@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 goruha marked this pull request as draft April 14, 2026 16:03
@mtweeman
Copy link
Copy Markdown
Contributor Author

mtweeman commented Apr 14, 2026

@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, 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?

@mtweeman mtweeman force-pushed the fix/pass-var-name branch from 05f1b62 to 9b69081 Compare April 14, 2026 19:35
@goruha
Copy link
Copy Markdown
Member

goruha commented Apr 14, 2026

@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

@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

goruha commented Apr 15, 2026

@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

@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-.]/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Needs triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants