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

[FEAT]: Support Fetching Files from Specific Commit SHA in github_repository_file Data Source #2227

Open
1 task done
shmuelarditi opened this issue Apr 11, 2024 · 2 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request

Comments

@shmuelarditi
Copy link

shmuelarditi commented Apr 11, 2024

Describe the need

I am seeking to enhance the github_repository_file data source by introducing the ability to fetch files from a specific commit SHA, in addition to the current capability of fetching from the tip of a branch. This functionality is aimed at solving the problem of fetching versions of files that exists at a specific point in the repository's history.

The introduction of direct commit SHA specification for file retrieval would significantly improve configuration management within Terraform workflows, especially in CI/CD processes where specific versions of files are critical.
This feature not only enhances precision and reliability but also aligns with best practices in automation and version control. Considering the GitHub API already supports file retrieval at specific commits, incorporating this feature into the Terraform GitHub provider appears both practical and highly beneficial.

something like:

data "github_repository_file" "example" {
  repository = "example-repo"
  file       = "path/to/myfile.txt"
  commit_sha = "abc123def456ghi789jkl"
}

SDK Version

This feature suggestion does not apply to a specific SDK version.

API Version

this feature would leverage the existing capabilities of the GitHub REST API, which already supports fetching file contents at a specific commit SHA through the ref parameter.

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@shmuelarditi shmuelarditi added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Apr 11, 2024
@liel-cohen-moovit
Copy link

Totally on board with this! I've faced the same issues and being able to grab files by commit SHA would be a game-changer for our CI/CD setups. Really hope they roll this out soon—it'd make things way smoother.

@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Apr 15, 2024
@wyatterp365

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants