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

Add a data source for refs. #1084

Merged
merged 2 commits into from
Mar 25, 2022
Merged

Conversation

youcandanch
Copy link
Contributor

Description

We're currently lacking a way to retrieve some basic information on a given ref within the Terraform provider. A crisp use case for this might be "I have a release that's based off of a tag, and I'd like to be able to retrieve the SHA1 for the HEAD commit in order to use elsewhere." This PR introduces a github_ref data source, which pretty shamelessly steals from the existing github_branch data source. I considered lifting out some of the code into a shared function, but the API calls are lightweight enough where I don't think there's that much harm from a few lines of duplication.

Tests are currently passing and documentation has been added to the markdown.

@youcandanch
Copy link
Contributor Author

@kfcampbell this one's probably simpler to land then #1066, which I haven't had as much time to work on. Any chance you could kick the workflows for this as well? Thanks so much!

@kfcampbell
Copy link
Member

@youcandanch Done!

Do you also mind linking to the sweet new docs page you just created in the .erb file? Thanks!

@kfcampbell kfcampbell added this to the v4.22.0 milestone Mar 11, 2022
@kfcampbell kfcampbell removed this from the v4.22.0 milestone Mar 18, 2022
@youcandanch
Copy link
Contributor Author

@kfcampbell all set!

@kfcampbell kfcampbell added this to the v4.23.0 milestone Mar 22, 2022
Copy link
Member

@kfcampbell kfcampbell left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! I'll shoot to get this released at the end of this week.

@kfcampbell kfcampbell merged commit 0caa62c into integrations:main Mar 25, 2022
@youcandanch youcandanch deleted the data-source-ref branch April 9, 2022 18:02
@youcandanch
Copy link
Contributor Author

@kfcampbell looks like an older commit of mine made it up here, which means there's some errors in the ref code. I'm gonna fix it, but I'm also gonna glance and see why tests were able to pass, as I don't think there's a way they should be passing right now. Issue opened here: #1108

kfcampbell added a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
kazaker pushed a commit to auto1-oss/terraform-provider-github that referenced this pull request Dec 28, 2022
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