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

RepositoryFile unable to use branchSelector due to wrong value returned #106

Open
asafhm opened this issue Oct 15, 2024 · 0 comments · May be fixed by #107
Open

RepositoryFile unable to use branchSelector due to wrong value returned #106

asafhm opened this issue Oct 15, 2024 · 0 comments · May be fixed by #107

Comments

@asafhm
Copy link

asafhm commented Oct 15, 2024

When attempting to use RepositoryFile resource with a branchSelector instead of branch, the value returned by the referenced object is the terraform ID of the branch resource, which unfortunately is not simply the branch name, but a repository_name:branch combination.
E.g.: my-repo:main instead of main .

This in turn causes an endless and confusing error in the RepositoryFile resource:

unexpected status code: 404 Not Found

Because the resource expects to receive only the branch name, using the branch field instead of branchSelector works.

I believe this can be fixed rather easily by using the Extractor option in the config.Reference object to let it know which field should be returned upon discovering the branch resource in branchSelector.

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 a pull request may close this issue.

1 participant