Skip to content

Commit 91fb489

Browse files
committed
Merge branch 'main' into fix-code-scanning-state
2 parents 765b0cc + d43be85 commit 91fb489

4,063 files changed

Lines changed: 367000 additions & 127363 deletions

File tree

Some content is hidden

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

.github/labeler.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Configuration for labeler - https://github.com/actions/labeler
2+
"Type: Breaking change":
3+
- head-branch:
4+
- '^breaking/'
5+
- '^breaking-'
6+
7+
"Type: Feature":
8+
- head-branch:
9+
- '^feat/'
10+
- '^feat-'
11+
- '^feature/'
12+
- '^feature-'
13+
14+
"Type: Bug":
15+
- head-branch:
16+
- '^fix/'
17+
- '^fix-'
18+
- '^bugfix/'
19+
- '^bugfix-'
20+
- '^bug/'
21+
- '^bug-'
22+
23+
"Deprecation":
24+
- head-branch:
25+
- '^deprecate/'
26+
- '^deprecate-'
27+
- '^deprecation/'
28+
- '^deprecation-'
29+
30+
"Type: Maintenance":
31+
- head-branch:
32+
- '^chore/'
33+
- '^chore-'
34+
- '^maintenance/'
35+
- '^maintenance-'
36+
- '^maint/'
37+
- '^maint-'
38+
- '^deps/'
39+
- '^deps-'
40+
- '^dependencies/'
41+
- '^dependencies-'
42+
# - changed-files:
43+
# - any-glob-to-any-file:
44+
# - .github/workflows/**
45+
# - .github/labeler.yml
46+
# - .github/dependabot.yml
47+
# - .github/release.yml
48+
49+
"Type: Documentation":
50+
- head-branch:
51+
- '^docs/'
52+
- '^docs-'
53+
- '^doc/'
54+
- '^doc-'
55+
# - changed-files:
56+
# - any-glob-to-any-file: 'website/**'

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Resolves #ISSUE_NUMBER
1515
*
1616

1717
### Pull request checklist
18+
- [ ] Schema migrations have been created if needed ([example](https://github.com/integrations/terraform-provider-github/pull/2820/files))
1819
- [ ] Tests for the changes have been added (for bug fixes / features)
1920
- [ ] Docs have been reviewed and added / updated if needed (for bug fixes / features)
2021

.github/workflows/add_to_octokit_project.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ jobs:
1111
name: Add issue to project
1212
runs-on: ubuntu-latest
1313
continue-on-error: true
14+
if: ${{ github.repository == 'integrations/terraform-provider-github' }}
1415
steps:
15-
- uses: actions/[email protected]
16+
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e #v1.0.2
1617
with:
1718
project-url: https://github.com/orgs/octokit/projects/10
1819
github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }}

.github/workflows/ci.yml

Lines changed: 119 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,134 @@ on:
55
branches: [main]
66
pull_request: {}
77

8+
permissions:
9+
contents: read # for actions/checkout
10+
11+
env:
12+
test_stacks_directory: test_tf_stacks
13+
814
jobs:
915
ci:
16+
name: Continuous Integration
1017
runs-on: ubuntu-latest
1118
env:
12-
GITHUB_TEST_ORGANIZATION: 'kfcampbell-terraform-provider'
19+
GITHUB_TEST_ORGANIZATION: kfcampbell-terraform-provider
1320
steps:
14-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
21+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
22+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
1623
with:
17-
go-version-file: 'go.mod'
24+
go-version-file: go.mod
1825
cache: true
1926
- run: make tools
2027
- run: make lint
2128
- run: make website-lint
2229
- run: make build
2330
- run: make test
31+
32+
generate-matrix:
33+
name: Generate matrix for test stacks
34+
runs-on: ubuntu-latest
35+
outputs:
36+
matrix: ${{ steps.set-matrix.outputs.matrix }}
37+
has-tests: ${{ steps.set-matrix.outputs.has-tests }}
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
41+
42+
- name: Generate matrix
43+
id: set-matrix
44+
run: |
45+
if [ -d "${{ env.test_stacks_directory }}" ]; then
46+
# find all directories and validate their names
47+
VALID_TESTS=()
48+
INVALID_TESTS=()
49+
50+
while IFS= read -r dir; do
51+
dirname=$(basename "$dir")
52+
# validate that directory name only contains alphanumeric, hyphens, underscores, and dots
53+
if [[ "$dirname" =~ ^[a-zA-Z0-9_.-]+$ ]]; then
54+
VALID_TESTS+=("$dirname")
55+
else
56+
INVALID_TESTS+=("$dirname")
57+
fi
58+
done < <(find ${{ env.test_stacks_directory }} -mindepth 1 -maxdepth 1 -type d)
59+
60+
# report invalid directory names if any
61+
if [ ${#INVALID_TESTS[@]} -gt 0 ]; then
62+
echo "::warning::Invalid test directory names found (must contain only alphanumeric, hyphens, underscores, and dots):"
63+
printf ' - %s (will be skipped)\n' "${INVALID_TESTS[@]}"
64+
fi
65+
66+
# create JSON array from valid tests
67+
if [ ${#VALID_TESTS[@]} -gt 0 ]; then
68+
TESTS=$(printf '%s\n' "${VALID_TESTS[@]}" | jq -R -s -c 'split("\n")[:-1]')
69+
echo "matrix=${TESTS}" >> $GITHUB_OUTPUT
70+
echo "has-tests=true" >> $GITHUB_OUTPUT
71+
echo "Found valid test directories: ${TESTS}"
72+
else
73+
echo "matrix=[]" >> $GITHUB_OUTPUT
74+
echo "has-tests=false" >> $GITHUB_OUTPUT
75+
echo "No valid test directories found"
76+
fi
77+
else
78+
echo "Test directory ${{ env.test_stacks_directory }} does not exist"
79+
echo "matrix=[]" >> $GITHUB_OUTPUT
80+
echo "has-tests=false" >> $GITHUB_OUTPUT
81+
fi
82+
83+
tests:
84+
name: Run tests for Terraform test stacks
85+
needs: [ci, generate-matrix]
86+
if: ${{ needs.generate-matrix.outputs.has-tests == 'true' }} # only run if there are some test stacks
87+
runs-on: ubuntu-latest
88+
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
tests: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
93+
94+
steps:
95+
- name: Checkout
96+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
97+
98+
- name: Setup Go
99+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
100+
with:
101+
go-version-file: go.mod
102+
cache: true
103+
104+
- name: Build provider
105+
run: go build -o terraform-provider-github
106+
107+
- name: Setup dev overrides
108+
run: |
109+
ROOT_DIR=$(pwd)
110+
cat > ~/.terraformrc << EOF
111+
provider_installation {
112+
dev_overrides {
113+
"integrations/github" = "${ROOT_DIR}"
114+
}
115+
direct {}
116+
}
117+
EOF
118+
119+
- name: Verify dev overrides setup
120+
run: cat ~/.terraformrc
121+
122+
- name: Setup Terraform
123+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
124+
with:
125+
terraform_version: 1.x
126+
127+
- name: Check Terraform version
128+
run: terraform version
129+
130+
- name: Terraform init
131+
continue-on-error: true # continue even if init fails
132+
run: terraform -chdir=./${{ env.test_stacks_directory }}/${{ matrix.tests }} init
133+
134+
- name: Terraform validate
135+
run: terraform -chdir=./${{ env.test_stacks_directory }}/${{ matrix.tests }} validate
136+
137+
- name: Clean up
138+
run: rm -f ~/.terraformrc terraform-provider-github

.github/workflows/codeql.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CodeQL"
1+
name: CodeQL
22

33
on:
44
push:
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
analyze:
14-
name: Analyze
14+
name: Analyze (${{ matrix.language }})
1515
runs-on: ubuntu-latest
1616
permissions:
1717
actions: read
@@ -21,27 +21,36 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
language: [ 'go' ]
24+
include:
25+
- language: actions
26+
build-mode: none
27+
queries: security-extended # can be 'default' (use empty for 'default'), 'security-and-quality', 'security-extended'
28+
- language: go
29+
build-mode: autobuild
30+
queries: '' # will be used 'default' queries
2531

2632
steps:
2733
- name: Checkout repository
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2935

30-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
36+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
37+
if: matrix.language == 'go'
3138
with:
3239
go-version-file: 'go.mod'
3340
cache: true
3441

3542
# Initializes the CodeQL tools for scanning.
3643
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
44+
uses: github/codeql-action/init@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
3845
with:
3946
languages: ${{ matrix.language }}
47+
build-mode: ${{ matrix['build-mode'] }}
48+
queries: ${{ matrix.queries }}
4049

4150
- name: Autobuild
42-
uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
51+
uses: github/codeql-action/autobuild@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
4352

4453
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
54+
uses: github/codeql-action/analyze@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
4655
with:
4756
category: "/language:${{matrix.language}}"

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

Lines changed: 6 additions & 6 deletions
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2020
with:
2121
ref: ${{ github.event.pull_request.head.ref }}
2222
fetch-depth: 2
23-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
23+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3838
with:
3939
ref: ${{ github.event.pull_request.head.ref }}
4040
fetch-depth: 2
41-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
41+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
70+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
7171
with:
7272
ref: ${{ github.event.pull_request.head.ref }}
7373
fetch-depth: 2
74-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
74+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
7575
with:
7676
go-version-file: 'go.mod'
7777
cache: true

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

Lines changed: 6 additions & 6 deletions
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2121
with:
2222
ref: ${{ github.event.pull_request.head.sha }}
23-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
23+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5353
with:
5454
ref: ${{ github.event.pull_request.head.sha }}
55-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
55+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
89+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
9090
with:
9191
ref: ${{ github.event.pull_request.head.sha }}
92-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
92+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
9393
with:
9494
go-version-file: 'go.mod'
9595
cache: true

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

Lines changed: 5 additions & 5 deletions
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2828
with:
2929
ref: ${{ github.event.pull_request.head.ref }}
3030
fetch-depth: 2
31-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
31+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4848
with:
4949
ref: ${{ github.event.pull_request.head.ref }}
5050
fetch-depth: 2
51-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
51+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
5252
with:
5353
go-version-file: 'go.mod'
5454
cache: true

0 commit comments

Comments
 (0)