Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
840ff4d
Add installation of `tfproviderlintx` to `make tools`
deiga Jan 11, 2026
2435da2
Add target for `make tf-provider-lint`
deiga Jan 11, 2026
d30694f
fix(lint): add schema descriptions to github_actions_environment_publ…
deiga Jan 25, 2026
da3ae34
fix(lint): add schema descriptions to github_actions_environment_secr…
deiga Jan 25, 2026
d412d11
fix(lint): add schema descriptions to github_actions_environment_vari…
deiga Jan 25, 2026
2e22395
fix(lint): add schema descriptions to github_actions_organization_oid…
deiga Jan 25, 2026
4e71a6f
fix(lint): add schema descriptions to github_actions_organization_pub…
deiga Jan 25, 2026
a76bade
fix(lint): add schema descriptions to github_actions_organization_reg…
deiga Jan 25, 2026
4c873dc
fix(lint): add schema descriptions to github_actions_organization_sec…
deiga Jan 25, 2026
8c46baf
fix(lint): add schema descriptions to github_actions_organization_var…
deiga Jan 25, 2026
844efaf
fix(lint): add schema descriptions to github_actions_public_key data …
deiga Jan 25, 2026
f2d88b8
fix(lint): add schema descriptions to github_actions_registration_tok…
deiga Jan 25, 2026
e0c51f6
fix(lint): add schema descriptions to github_actions_repository_oidc_…
deiga Jan 25, 2026
1d3f986
fix(lint): add schema descriptions to github_actions_secrets data source
deiga Jan 25, 2026
26b9287
fix(lint): add schema descriptions to github_actions_variables data s…
deiga Jan 25, 2026
87e7eeb
fix(lint): add schema descriptions to github_app data source
deiga Jan 25, 2026
67dd64c
fix(lint): add schema descriptions to github_branch_protection_rules …
deiga Jan 25, 2026
297d7cf
fix(lint): add schema descriptions to github_branch data source
deiga Jan 25, 2026
39494bf
fix(lint): add schema descriptions to github_codespaces_organization_…
deiga Jan 25, 2026
388f734
fix(lint): add schema descriptions to github_codespaces_organization_…
deiga Jan 25, 2026
206f359
fix(lint): add schema descriptions to github_codespaces_public_key da…
deiga Jan 25, 2026
29e906a
fix(lint): add schema descriptions to github_codespaces_secrets data …
deiga Jan 25, 2026
6ef6005
fix(lint): add schema descriptions to github_codespaces_user_public_k…
deiga Jan 25, 2026
4f1cab5
fix(lint): add schema descriptions to github_dependabot_organization_…
deiga Jan 25, 2026
078d3f1
fix(lint): add schema descriptions to github_dependabot_public_key an…
deiga Jan 25, 2026
db9bf26
fix(lint): add schema descriptions to github_collaborators data source
deiga Jan 25, 2026
c182fb4
fix(lint): add schema descriptions to github_enterprise data source
deiga Jan 25, 2026
b449a17
fix(lint): add schema descriptions to github_external_groups data source
deiga Jan 25, 2026
b0b7f68
fix(lint): add schema descriptions to github_ip_ranges data source
deiga Jan 25, 2026
c4f102a
fix(lint): add schema descriptions to github_issue_labels data source
deiga Jan 25, 2026
10bd9ad
fix(lint): add schema descriptions to membership and organization dat…
deiga Jan 25, 2026
a2dcf18
fix(lint): add schema descriptions to organization ip/teams data sources
deiga Jan 25, 2026
b2cd711
fix(lint): add schema descriptions to organization/ref/release data s…
deiga Jan 25, 2026
6d98a24
fix(lint): add schema descriptions to repositories/autolink/branches …
deiga Jan 25, 2026
6262b3e
fix(lint): add schema descriptions to repository deploy/environment d…
deiga Jan 25, 2026
356580c
fix(lint): add schema descriptions to repository milestone/teams/pull…
deiga Jan 25, 2026
4f05832
fix(lint): add schema descriptions to repository/rest_api/ssh_keys da…
deiga Jan 25, 2026
1cf51dc
fix(lint): add schema descriptions to team/tree/user data sources
deiga Jan 25, 2026
ea7842c
fix(lint): add schema descriptions to user/branch data sources and re…
deiga Jan 25, 2026
f2ac390
fix(lint): add schema descriptions to issue/project/release resources
deiga Jan 25, 2026
548df00
fix(lint): add schema descriptions to webhook/collaborator/deploy key…
deiga Jan 25, 2026
fefacfc
fix(lint): add schema descriptions to team/user resources
deiga Jan 25, 2026
705c89e
fix(lint): add schema descriptions to team and repository resources
deiga Jan 25, 2026
66e94df
fix(lint): add schema descriptions to migration and ruleset resources
deiga Jan 25, 2026
53a12fa
fix(lint): add resource descriptions for XR005 compliance
deiga Jan 25, 2026
9663178
fix(lint): use RandString instead of RandStringFromCharSet for AT009 …
deiga Jan 25, 2026
1cdd577
fix(lint): resolve R001, R002, S024, S013, R010, S019, S006, S020 issues
deiga Jan 25, 2026
85297bc
fix(lint): resolve R004, AT012, and add Importer to user_gpg_key
deiga Jan 25, 2026
74d23d8
fix(lint): resolve last linter issues
deiga Jan 26, 2026
623e1d3
Update contributing guide
deiga Jan 26, 2026
4d1dbf5
Add explanations for disabled linters
deiga Jan 26, 2026
be9d014
Address any new linting issues
deiga Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Before submitting an issue or a pull request, please search the repository for e
1. Fork and clone the repository.
2. Create a new branch: `git switch -c my-branch-name`.
3. Make your change, add tests, and make sure the tests still pass.
4. Push to your fork and submit a pull request.
5. Pat yourself on the back and wait for your pull request to be reviewed and merged.
4. Run `make fmt; make lint; make tf-provider-lint` to check for formatting, linting, and provider linting errors.
5. Push to your fork and submit a pull request.
6. Pat yourself on the back and wait for your pull request to be reviewed and merged.

Here are a few things you can do that will increase the likelihood of your pull request being accepted:

Expand All @@ -33,9 +34,9 @@ This section describes a typical sequence performed when developing locally. Ful
Once you have the repository cloned, there's a couple of additional steps you'll need to take. Since most of the testing is acceptance or integration testing, we need to manipulate real GitHub resources in order to run it. Useful setup steps are listed below:

- If you haven't already, [create a GitHub organization you can use for testing](#github-organization).
- Optional: you may find it beneficial to create a test user as well in order to avoid potential rate-limiting issues on your main account.
- Your organization _must_ have a repository called `terraform-template-module`. The [terraformtesting/terraform-template-module](https://github.com/terraformtesting/terraform-template-module) repo is a good, re-usable example.
- You _must_ make sure that the "Template Repository" item in Settings is checked for this repo.
- Optional: you may find it beneficial to create a test user as well in order to avoid potential rate-limiting issues on your main account.
- Your organization _must_ have a repository called `terraform-template-module`. The [terraformtesting/terraform-template-module](https://github.com/terraformtesting/terraform-template-module) repo is a good, re-usable example.
- You _must_ make sure that the "Template Repository" item in Settings is checked for this repo.
- If you haven't already, generate a Personal Access Token (PAT) for authenticating your test runs.
- Export the necessary configuration for authenticating your provider with GitHub

Expand All @@ -52,7 +53,7 @@ Once you have the repository cloned, there's a couple of additional steps you'll
### Local Development Iteration

1. Write a test describing what you will fix. See [`github_label`](./github/resource_github_issue_label_test.go) for an example format.
1. Run your test and observe it fail. Enabling debug output allows for observing the underlying requests and responses made as well as viewing state (search `STATE:`) generated during the acceptance test run.
2. Run your test and observe it fail. Enabling debug output allows for observing the underlying requests and responses made as well as viewing state (search `STATE:`) generated during the acceptance test run.

```sh
TF_LOG=DEBUG TF_ACC=1 go test -v ./... -run ^TestAccGithubIssueLabel
Expand Down
26 changes: 25 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ default: build
tools:
go install github.com/client9/misspell/cmd/misspell@v0.3.4
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.0
go install github.com/bflad/tfproviderlint/cmd/tfproviderlintx@latest

build: lintcheck
CGO_ENABLED=0 go build -ldflags="-s -w" ./...
Expand All @@ -46,6 +47,29 @@ lintcheck:
@echo "==> Checking source code against linters..."
golangci-lint run ./...

tf-provider-lint:
@branch=$$(git rev-parse --abbrev-ref HEAD); \
printf "==> Running TF provider lint on branch: \033[1m%s\033[0m...\n" "🌿 $$branch 🌿";
# Disabled linter rules:
# AT001: TestCase missing CheckDestroy - not yet adopted across all tests
# AT003: should use underscores in acc test names - not yet adopted across all tests
# AT004: provider declaration should be omitted - intentionally kept for provider configuration tests
# AT006: acc tests should not contain multiple resource.Test() invocations - not yet adopted across all tests
# XAT001: acceptance test should use ErrorCheck - not all resources support destroy verification
# XR003: resource should configure Timeouts - not yet adopted across all resources
# XR007: avoid os/exec.Command - intentionally used for GitHub CLI integration and ssh-keygen in tests
# XS002: schema should use keys in alphabetical order - not sure we want to enforce this
tfproviderlintx \
-AT001=false \
-AT003=false \
-AT004=false \
-AT006=false \
-XAT001=false \
-XR003=false \
-XR007=false \
-XS002=false \
$(TEST)

test:
@branch=$$(git rev-parse --abbrev-ref HEAD); \
printf "==> Running unit tests on branch: \033[1m%s\033[0m...\n" "🌿 $$branch 🌿"
Expand Down Expand Up @@ -84,4 +108,4 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build test testacc fmt lint lintcheck tools website website-lint website-test sweep
.PHONY: build test testacc fmt lint lintcheck tools website website-lint website-test sweep tf-provider-lint
20 changes: 12 additions & 8 deletions github/data_source_github_actions_environment_public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ func dataSourceGithubActionsEnvironmentPublicKey() *schema.Resource {

Schema: map[string]*schema.Schema{
"repository": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
Description: "The name of the repository.",
},
"environment": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
Description: "The name of the environment.",
},
"key_id": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The identifier for the key.",
},
"key": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The Base64 encoded public key.",
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestAccGithubActionsEnvironmentPublicKeyDataSource(t *testing.T) {
t.Run("queries a repository environment public key without error", func(t *testing.T) {
randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum)
randomID := acctest.RandString(5)
repoName := fmt.Sprintf("%srepo-env-pubkey-%s", testResourcePrefix, randomID)

config := fmt.Sprintf(`
Expand Down
27 changes: 17 additions & 10 deletions github/data_source_github_actions_environment_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,40 @@ func dataSourceGithubActionsEnvironmentSecrets() *schema.Resource {
Optional: true,
Computed: true,
ConflictsWith: []string{"name"},
Description: "Full name of the repository (in org/name format).",
},
"name": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ConflictsWith: []string{"full_name"},
Description: "The name of the repository.",
},
"environment": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
Description: "The name of the environment.",
},
"secrets": {
Type: schema.TypeList,
Computed: true,
Type: schema.TypeList,
Computed: true,
Description: "List of secrets for the environment.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The name of the secret.",
},
"created_at": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Timestamp of the secret creation.",
},
"updated_at": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Timestamp of the secret last update.",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestAccGithubActionsEnvironmentSecretsDataSource(t *testing.T) {
t.Run("queries actions secrets from an environment", func(t *testing.T) {
randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum)
randomID := acctest.RandString(5)
repoName := fmt.Sprintf("%srepo-env-secrets-%s", testResourcePrefix, randomID)

config := fmt.Sprintf(`
Expand Down
32 changes: 20 additions & 12 deletions github/data_source_github_actions_environment_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,45 @@ func dataSourceGithubActionsEnvironmentVariables() *schema.Resource {
Optional: true,
Computed: true,
ConflictsWith: []string{"name"},
Description: "Full name of the repository (in org/name format).",
},
"name": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ConflictsWith: []string{"full_name"},
Description: "The name of the repository.",
},
"environment": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
Description: "The name of the environment.",
},
"variables": {
Type: schema.TypeList,
Computed: true,
Type: schema.TypeList,
Computed: true,
Description: "List of variables for the environment.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The name of the variable.",
},
"value": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The value of the variable.",
},
"created_at": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Timestamp of the variable creation.",
},
"updated_at": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Timestamp of the variable last update.",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestAccGithubActionsEnvironmentVariablesDataSource(t *testing.T) {
t.Run("queries actions variables from an environment", func(t *testing.T) {
randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum)
randomID := acctest.RandString(5)
repoName := fmt.Sprintf("%srepo-env-vars-%s", testResourcePrefix, randomID)

config := fmt.Sprintf(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import (

func dataSourceGithubActionsOrganizationOIDCSubjectClaimCustomizationTemplate() *schema.Resource {
return &schema.Resource{
Read: dataSourceGithubActionsOrganizationOIDCSubjectClaimCustomizationTemplateRead,
Description: "Use this data source to retrieve the OpenID Connect subject claim customization template for an organization.",
Read: dataSourceGithubActionsOrganizationOIDCSubjectClaimCustomizationTemplateRead,

Schema: map[string]*schema.Schema{
"include_claim_keys": {
Type: schema.TypeList,
Computed: true,
Type: schema.TypeList,
Computed: true,
Description: "A list of OpenID Connect claim keys.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand Down
13 changes: 8 additions & 5 deletions github/data_source_github_actions_organization_public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ import (

func dataSourceGithubActionsOrganizationPublicKey() *schema.Resource {
return &schema.Resource{
Read: dataSourceGithubActionsOrganizationPublicKeyRead,
Description: "Use this data source to retrieve the public key for an organization's GitHub Actions secrets.",
Read: dataSourceGithubActionsOrganizationPublicKeyRead,

Schema: map[string]*schema.Schema{
"key_id": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The identifier for the key.",
},
"key": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The Base64 encoded public key.",
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ import (

func dataSourceGithubActionsOrganizationRegistrationToken() *schema.Resource {
return &schema.Resource{
Read: dataSourceGithubActionsOrganizationRegistrationTokenRead,
Description: "Use this data source to retrieve a registration token for a GitHub Actions self-hosted runner in an organization.",
Read: dataSourceGithubActionsOrganizationRegistrationTokenRead,

Schema: map[string]*schema.Schema{
"token": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The token that has been retrieved.",
},
"expires_at": {
Type: schema.TypeInt,
Computed: true,
Type: schema.TypeInt,
Computed: true,
Description: "The token expiration date as a Unix timestamp.",
},
},
}
Expand Down
28 changes: 17 additions & 11 deletions github/data_source_github_actions_organization_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,35 @@ import (

func dataSourceGithubActionsOrganizationSecrets() *schema.Resource {
return &schema.Resource{
Read: dataSourceGithubActionsOrganizationSecretsRead,
Description: "Use this data source to retrieve the list of secrets for a GitHub organization.",
Read: dataSourceGithubActionsOrganizationSecretsRead,

Schema: map[string]*schema.Schema{
"secrets": {
Type: schema.TypeList,
Computed: true,
Type: schema.TypeList,
Computed: true,
Description: "List of secrets for the organization.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The name of the secret.",
},
"visibility": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "The visibility of the secret (all, private, or selected).",
},
"created_at": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Timestamp of the secret creation.",
},
"updated_at": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Timestamp of the secret last update.",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestAccGithubActionsOrganizationSecretsDataSource(t *testing.T) {
t.Run("queries organization actions secrets from a repository", func(t *testing.T) {
randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum)
randomID := acctest.RandString(5)

config := fmt.Sprintf(`
resource "github_actions_organization_secret" "test" {
Expand Down
Loading