-
Notifications
You must be signed in to change notification settings - Fork 763
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
[Feature Request] Pull Requests and git
branch publishes
#286
Comments
Potentially related issues: |
@paultyng - thanks for discussing this yesterday. Key takeaways I've captured are below.
☝️ has been implemented over in https://github.com/edahlseng/terraform-provider-repository-template (❤️@edahlseng) and can be leveraged as a base. Doing so allows us to move the design away from the procedural
The initial release of this feature will support simple text files. Documentation should reflect this and deter content that is not a unicode string. I've updated the suggested UX in the first comment to reflect the new design. The first iteration is archived here: # // NewPullRequest represents a new pull request to be created.
# // https://github.com/google/go-github/blob/v28.0.1/github/pulls.go#L242-L251
# type NewPullRequest struct {
# Title *string `json:"title,omitempty"`
# Head *string `json:"head,omitempty"`
# Base *string `json:"base,omitempty"`
# Body *string `json:"body,omitempty"`
# Issue *int `json:"issue,omitempty"`
# MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"`
# Draft *bool `json:"draft,omitempty"`
# }
resource "github_pull_request" "create_actions" {
title = "Create standard Actions for this repo"
base = "master"
# Branch to be created, populated and associated to this PR
head = "${format("create_actions_%s", random_id.create_actions_id.hex}"
body = "${local.create_actions_body}"
issue = "${local.create_actions_issue}"
# Abstraction for Git Tree and Tree Entries as a map of paths to rendered templates
content = {
".github/workflows/build.yml" = templatefile("path/to/build.yml", { foo = "bar" }),
".github/workflows/release.yml" = templatefile("path/to/release.yml", { foo = "bar" }),
}
} |
Woot, super excited to see interest in features like this in an upstream provider! Let me know if there's anything I can do to help. Always happy to accept pull requests on my provider in the meantime, too! |
This was partially addressed by https://github.com/terraform-providers/terraform-provider-github/pull/318. There is follow up work needed to got Pull Request support added in now that a base layer capable of modifying files has landed. |
Overview
👋 from GitHub's datacenter team. We are requesting guidance on functionality for this pair of features:
Add limited support for the Git Data API
Add limited support for the Pull Requests API
Package features into a quality 🚢
cc https://github.com/terraform-providers/terraform-provider-github/issues/254 (related solution to initializing a repo with Terraform)
Suggested UX
This resource block accomplishes the following:
content
map)repository
target_branch
working_branch
Further Discussion
This continues an existing discussion with @paultyng:
We use go-google to achieve this currently. This example is essentially what we've had running for a couple years now to automate creation of application repositories. Does Terraform need to store blobs that are uploaded to a branch?
While tempting to leverage
git
directly, I want to give the GitHub Data API a shot to avoid creating a new provider. This remains an option if adding resources to the GitHub provider becomes untenable.Here are some additional questions:
provisioner
rather than aprovider
?The text was updated successfully, but these errors were encountered: