Skip to content

Commit fd5431f

Browse files
authored
Merge branch 'main' into gpg-sign
2 parents 6569501 + 1ca7092 commit fd5431f

File tree

490 files changed

+24857
-4595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

490 files changed

+24857
-4595
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
env:
1212
GITHUB_TEST_ORGANIZATION: 'kfcampbell-terraform-provider'
1313
steps:
14-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
15-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
1616
with:
1717
go-version-file: 'go.mod'
1818
cache: true

.github/workflows/codeql.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2929

30-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
30+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3131
with:
3232
go-version-file: 'go.mod'
3333
cache: true
3434

3535
# Initializes the CodeQL tools for scanning.
3636
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
37+
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
3838
with:
3939
languages: ${{ matrix.language }}
4040

4141
- name: Autobuild
42-
uses: github/codeql-action/autobuild@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
42+
uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
4343

4444
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
45+
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
4646
with:
4747
category: "/language:${{matrix.language}}"

.github/workflows/dotcom-acceptance-tests-all.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2020
with:
2121
ref: ${{ github.event.pull_request.head.ref }}
2222
fetch-depth: 2
23-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
23+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2424
with:
2525
go-version-file: 'go.mod'
2626
cache: true
@@ -34,11 +34,11 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3838
with:
3939
ref: ${{ github.event.pull_request.head.ref }}
4040
fetch-depth: 2
41-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
41+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
4242
with:
4343
go-version-file: 'go.mod'
4444
cache: true
@@ -67,11 +67,11 @@ jobs:
6767
runs-on: ubuntu-latest
6868
steps:
6969
- name: Checkout
70-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
70+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7171
with:
7272
ref: ${{ github.event.pull_request.head.ref }}
7373
fetch-depth: 2
74-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
74+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
7575
with:
7676
go-version-file: 'go.mod'
7777
cache: true

.github/workflows/dotcom-acceptance-tests-manual.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2
1818
)"
1919
- name: Checkout
20-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121
with:
2222
ref: ${{ github.event.pull_request.head.sha }}
23-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
23+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2424
with:
2525
go-version-file: 'go.mod'
2626
cache: true
@@ -49,10 +49,10 @@ jobs:
4949
jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2
5050
)"
5151
- name: Checkout
52-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
52+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5353
with:
5454
ref: ${{ github.event.pull_request.head.sha }}
55-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
55+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
5656
with:
5757
go-version-file: 'go.mod'
5858
cache: true
@@ -86,10 +86,10 @@ jobs:
8686
jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2
8787
)"
8888
- name: Checkout
89-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
89+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9090
with:
9191
ref: ${{ github.event.pull_request.head.sha }}
92-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
92+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
9393
with:
9494
go-version-file: 'go.mod'
9595
cache: true

.github/workflows/dotcom-acceptance-tests.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1515
with:
1616
ref: ${{ github.event.pull_request.head.ref }}
1717
fetch-depth: 2
@@ -24,11 +24,11 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
with:
2929
ref: ${{ github.event.pull_request.head.ref }}
3030
fetch-depth: 2
31-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
31+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3232
with:
3333
go-version-file: 'go.mod'
3434
cache: true
@@ -44,11 +44,11 @@ jobs:
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Checkout
47-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
47+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4848
with:
4949
ref: ${{ github.event.pull_request.head.ref }}
5050
fetch-depth: 2
51-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
51+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
5252
with:
5353
go-version-file: 'go.mod'
5454
cache: true

.github/workflows/ghes-acceptance-tests-all.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3232
with:
3333
ref: ${{ github.event.pull_request.head.ref }}
3434
fetch-depth: 2
35-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
35+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3636
with:
3737
go-version-file: 'go.mod'
3838
cache: true
@@ -47,11 +47,11 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- name: Checkout
50-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
50+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5151
with:
5252
ref: ${{ github.event.pull_request.head.ref }}
5353
fetch-depth: 2
54-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
54+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
5555
with:
5656
go-version-file: 'go.mod'
5757
cache: true
@@ -82,11 +82,11 @@ jobs:
8282
runs-on: ubuntu-latest
8383
steps:
8484
- name: Checkout
85-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
85+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8686
with:
8787
ref: ${{ github.event.pull_request.head.ref }}
8888
fetch-depth: 2
89-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
89+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
9090
with:
9191
go-version-file: 'go.mod'
9292
cache: true

.github/workflows/ghes-acceptance-tests.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2727
with:
2828
ref: ${{ github.event.pull_request.head.ref }}
2929
fetch-depth: 2
30-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
30+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3131
with:
3232
go-version-file: 'go.mod'
3333
cache: true
@@ -42,11 +42,11 @@ jobs:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Checkout
45-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4646
with:
4747
ref: ${{ github.event.pull_request.head.ref }}
4848
fetch-depth: 2
49-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
49+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
5050
with:
5151
go-version-file: 'go.mod'
5252
cache: true
@@ -63,11 +63,11 @@ jobs:
6363
runs-on: ubuntu-latest
6464
steps:
6565
- name: Checkout
66-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
66+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6767
with:
6868
ref: ${{ github.event.pull_request.head.ref }}
6969
fetch-depth: 2
70-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
70+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
7171
with:
7272
go-version-file: 'go.mod'
7373
cache: true

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ jobs:
1717
goreleaser:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121
with:
2222
# Allow goreleaser to access older tag information.
2323
fetch-depth: 0
2424

25-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
25+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2626
with:
2727
go-version-file: 'go.mod'
2828
cache: true
2929

3030
- name: Import GPG key
31-
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
31+
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
3232
id: import_gpg
3333
with:
3434
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
3535
passphrase: ${{ secrets.PASSPHRASE }}
3636

3737
- name: Run GoReleaser
38-
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
38+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
3939
with:
4040
args: release --clean
4141
version: latest

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Setting a `processId` of 0 allows a dropdown to select the process of the provid
8181

8282
0. Add a sleep call (e.g. `time.Sleep(10 * time.Second)`) in the [`func providerConfigure(p *schema.Provider) schema.ConfigureFunc`](https://github.com/integrations/terraform-provider-github/blob/cec7e175c50bb091feecdc96ba117067c35ee351/github/provider.go#L274C1-L274C64) before the immediate `return` call. This will allow time to connect the debugger while the provider is initializing, before any critical logic happens.
8383

84-
0. Build the terraform provider with debug flags enabled and copy it to the appropriate bin folder with a command like `go build -gcflags="all=-N -l" -o ~/go/bin`.
84+
0. Build the terraform provider with debug flags enabled and copy it to the appropriate bin folder with a command like `go build -gcflags="all=-N -l" -o ~/go/bin/`.
8585

8686
0. Create or edit a `dev.tfrc` that points toward the newly-built binary, and export the `TF_CLI_CONFIG_FILE` variable to point to it. Further instructions on this process may be found in the [Building the provider](#using-a-local-version-of-the-provider) section.
8787

@@ -99,7 +99,7 @@ Manual testing should be performed on each PR opened in order to validate the pr
9999
Build the provider and specify the output directory:
100100

101101
```sh
102-
$ go build -gcflags="all=-N -l" -o ~/go/bin
102+
$ go build -gcflags="all=-N -l" -o ~/go/bin/
103103
```
104104

105105
This enables verifying your locally built provider using examples available in the `examples/` directory.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Organization Security Manager Example
2+
3+
This example demonstrates creating an organization security manager team.
4+
5+
It will:
6+
- Create a team with the specified `team_name` in the specified `owner` organization
7+
- Assign the organization security manager role to the team
8+
9+
The GitHub token must have the `admin:org` scope.
10+
11+
```console
12+
export GITHUB_OWNER=my-organization
13+
export GITHUB_TOKEN=ghp_###
14+
export GITHUB_TEAM_NAME="My Security Manager Team"
15+
```
16+
17+
```console
18+
terraform apply \
19+
-var "owner=${GITHUB_OWNER}" \
20+
-var "github_token=${GITHUB_TOKEN}" \
21+
-var "team_name=${GITHUB_TEAM_NAME}"
22+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "github_team" "security_managers" {
2+
name = var.team_name
3+
description = "A team of organization security managers"
4+
}
5+
6+
resource "github_organization_security_manager" "security_managers" {
7+
team_slug = github_team.security_managers.slug
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "github_security_managers_team" {
2+
description = "The organization security managers team"
3+
value = github_organization_security_manager.security_managers
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
provider "github" {
2+
owner = var.owner
3+
token = var.github_token
4+
}
5+
6+
terraform {
7+
required_providers {
8+
github = {
9+
source = "integrations/github"
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
variable "github_token" {
2+
description = "GitHub access token used to configure the provider"
3+
type = string
4+
}
5+
6+
variable "owner" {
7+
description = "GitHub owner used to configure the provider"
8+
type = string
9+
}
10+
11+
variable "team_name" {
12+
description = "The name to use for the GitHub team"
13+
type = string
14+
}

github/apps.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"net/http"
1111
"time"
1212

13-
"gopkg.in/square/go-jose.v2"
14-
"gopkg.in/square/go-jose.v2/jwt"
13+
"github.com/go-jose/go-jose/v3"
14+
"github.com/go-jose/go-jose/v3/jwt"
1515
)
1616

1717
// GenerateOAuthTokenFromApp generates a GitHub OAuth access token from a set of valid GitHub App credentials.

github/apps_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"testing"
1111
"time"
1212

13-
"gopkg.in/square/go-jose.v2"
14-
"gopkg.in/square/go-jose.v2/jwt"
13+
"github.com/go-jose/go-jose/v3"
14+
"github.com/go-jose/go-jose/v3/jwt"
1515
)
1616

1717
const (

github/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99
"time"
1010

11-
"github.com/google/go-github/v63/github"
11+
"github.com/google/go-github/v66/github"
1212
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging"
1313
"github.com/shurcooL/githubv4"
1414
"golang.org/x/oauth2"

github/data_source_github_actions_environment_secrets.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"net/url"
77

8-
"github.com/google/go-github/v63/github"
8+
"github.com/google/go-github/v66/github"
99

1010
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1111
)

0 commit comments

Comments
 (0)