Skip to content

Commit 4d37f19

Browse files
committed
chore
1 parent af6f6c7 commit 4d37f19

File tree

3 files changed

+105
-29
lines changed

3 files changed

+105
-29
lines changed

.gitignore

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# Go workspace file
18+
go.work
19+
20+
# Local .terraform directories
21+
**/.terraform/*
22+
23+
# .tfstate files
24+
*.tfstate
25+
*.tfstate.*
26+
27+
# Crash log files
28+
crash.log
29+
crash.*.log
30+
31+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
32+
# password, private keys, and other secrets. These should not be part of version
33+
# control as they are data points which are potentially sensitive and subject
34+
# to change depending on the environment.
35+
*.tfvars
36+
*.tfvars.json
37+
38+
# Ignore override files as they are usually used to override resources locally and so
39+
# are not checked in
40+
override.tf
41+
override.tf.json
42+
*_override.tf
43+
*_override.tf.json
44+
45+
# Include override files you do wish to add to version control using negated pattern
46+
# !example_override.tf
47+
48+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
49+
# example: *tfplan*
50+
51+
# Ignore CLI configuration files
52+
.terraformrc
53+
terraform.rc
54+
55+
# Built provider binary
56+
terraform-provider-kw-github
57+
58+
# IDE files
59+
.vscode/
60+
.idea/
61+
*.swp
62+
*.swo
63+
64+
# OS generated files
65+
.DS_Store
66+
.DS_Store?
67+
._*
68+
.Spotlight-V100
69+
.Trashes
70+
ehthumbs.db
71+
Thumbs.db
72+
73+
# Documentation changes should not trigger releases
74+
README.md

.tagpr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@
4949
vPrefix = true
5050
releaseBranch = main
5151
versionFile = -
52+
excludePaths = README.md

README.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A Terraform provider for managing GitHub repository rulesets with enhanced suppo
1515
## Requirements
1616

1717
- [Terraform](https://www.terraform.io/downloads.html) >= 1.0
18-
- [Go](https://golang.org/doc/install) >= 1.23 (for development)
18+
- [Go](https://golang.org/doc/install) >= 1.23.0 (for development)
1919
- GitHub Personal Access Token with appropriate permissions
2020

2121
## Installation
@@ -27,9 +27,9 @@ To use this provider in your Terraform configuration:
2727
```hcl
2828
terraform {
2929
required_providers {
30-
kw_github = {
31-
source = "knowledge-work/kw-github"
32-
version = "~> 1.0"
30+
kwgithub = {
31+
source = "knowledge-work/kwgithub"
32+
version = "~> 0.0.2"
3333
}
3434
}
3535
}
@@ -61,7 +61,7 @@ Or use the development override in your `~/.terraformrc`:
6161
```hcl
6262
provider_installation {
6363
dev_overrides {
64-
"knowledge-work/kw-github" = "/path/to/your/terraform-provider-kw-github"
64+
"knowledge-work/kwgithub" = "/path/to/your/terraform-provider-kw-github"
6565
}
6666
direct {}
6767
}
@@ -74,14 +74,14 @@ provider_installation {
7474
```hcl
7575
terraform {
7676
required_providers {
77-
kw_github = {
78-
source = "knowledge-work/kw_github"
79-
version = "1.0.0"
77+
kwgithub = {
78+
source = "knowledge-work/kwgithub"
79+
version = "~> 0.0.2"
8080
}
8181
}
8282
}
8383
84-
provider "kw_github" {
84+
provider "kwgithub" {
8585
# GitHub token (optional, can also use GITHUB_TOKEN environment variable)
8686
token = var.github_token
8787
@@ -97,7 +97,7 @@ The provider supports two authentication methods:
9797
1. **Provider Configuration** (Recommended):
9898

9999
```hcl
100-
provider "kw_github" {
100+
provider "kwgithub" {
101101
token = var.github_token
102102
}
103103
```
@@ -112,14 +112,14 @@ The provider will use the `token` attribute if provided, otherwise it will fall
112112

113113
## Resources
114114

115-
### `kw_github_ruleset_allowed_merge_methods`
115+
### `kwgithub_ruleset_allowed_merge_methods`
116116

117117
Manages allowed merge methods for a GitHub repository ruleset.
118118

119119
#### Example Usage
120120

121121
```hcl
122-
resource "kw_github_ruleset_allowed_merge_methods" "example" {
122+
resource "kwgithub_ruleset_allowed_merge_methods" "example" {
123123
repository = "owner/repo"
124124
ruleset_id = "123456"
125125
allowed_merge_methods = ["merge", "squash"]
@@ -129,7 +129,7 @@ resource "kw_github_ruleset_allowed_merge_methods" "example" {
129129
130130
# Ensure this runs after other ruleset changes
131131
depends_on = [
132-
kw_github_other_ruleset_resource.example
132+
kwgithub_other_ruleset_resource.example
133133
]
134134
}
135135
```
@@ -148,7 +148,7 @@ resource "kw_github_ruleset_allowed_merge_methods" "example" {
148148
#### Import
149149

150150
```bash
151-
terraform import kw_github_ruleset_allowed_merge_methods.example owner/repo:123456
151+
terraform import kwgithub_ruleset_allowed_merge_methods.example owner/repo:123456
152152
```
153153

154154
## Why This Provider?
@@ -166,7 +166,7 @@ While the official GitHub Terraform provider (`integrations/github`) supports re
166166

167167
## Use Cases
168168

169-
1. **Complement Official Provider**: Use `github_repository_ruleset` for main ruleset configuration and `kw_github_ruleset_allowed_merge_methods` for reliable merge method management
169+
1. **Complement Official Provider**: Use `github_repository_ruleset` for main ruleset configuration and `kwgithub_ruleset_allowed_merge_methods` for reliable merge method management
170170
2. **Existing Rulesets**: Manage merge methods for rulesets created outside of Terraform
171171
3. **Complex Dependencies**: Handle scenarios where ruleset updates from other sources affect merge methods
172172

@@ -179,9 +179,9 @@ terraform {
179179
source = "integrations/github"
180180
version = "~> 6.0"
181181
}
182-
kw_github = {
183-
source = "knowledge-work/kw_github"
184-
version = "1.0.0"
182+
kwgithub = {
183+
source = "knowledge-work/kwgithub"
184+
version = "~> 0.0.2"
185185
}
186186
}
187187
}
@@ -190,7 +190,7 @@ provider "github" {
190190
token = var.github_token
191191
}
192192
193-
provider "kw_github" {
193+
provider "kwgithub" {
194194
token = var.github_token
195195
}
196196
@@ -223,7 +223,7 @@ resource "github_repository_ruleset" "main" {
223223
}
224224
225225
# Manage merge methods with our specialized provider
226-
resource "kw_github_ruleset_allowed_merge_methods" "main" {
226+
resource "kwgithub_ruleset_allowed_merge_methods" "main" {
227227
repository = "myorg/myrepo"
228228
ruleset_id = github_repository_ruleset.main.id
229229
allowed_merge_methods = ["merge", "squash"]
@@ -250,30 +250,31 @@ resource "kw_github_ruleset_allowed_merge_methods" "main" {
250250
### Building from Source
251251

252252
```bash
253+
make build
254+
# Or manually:
253255
go build -o terraform-provider-kw-github ./cmd/terraform-provider-kwgithub
254256
```
255257

256258
### Running Tests
257259

258260
```bash
259261
# Unit tests
260-
go test ./...
262+
make test
261263

262264
# Acceptance tests (requires GITHUB_TOKEN)
263-
TF_ACC=1 go test ./... -v
265+
make test-acc
264266
```
265267

266268
### Code Quality
267269

268270
```bash
269-
# Format code
270-
go fmt ./...
271+
# Format and lint code
272+
make lint
271273

272-
# Run linter
273-
go vet ./...
274-
275-
# Tidy dependencies
276-
go mod tidy
274+
# Or run individual commands:
275+
make fmt # Format code
276+
make vet # Run go vet
277+
make tidy # Tidy dependencies
277278
```
278279

279280
## Contributing

0 commit comments

Comments
 (0)