Skip to content

Commit aced599

Browse files
Merge branch 'main' into maintenance/add-attestation
2 parents 4d2ad53 + 78196d6 commit aced599

File tree

3,487 files changed

+327671
-109517
lines changed

Some content is hidden

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

3,487 files changed

+327671
-109517
lines changed

.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/workflows/ci.yml

Lines changed: 118 additions & 3 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
1522
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.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@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
97+
98+
- name: Setup Go
99+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.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: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
34+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
2935

3036
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.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@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.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@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
51+
uses: github/codeql-action/autobuild@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
4352

4453
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
19+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
2020
with:
2121
ref: ${{ github.event.pull_request.head.ref }}
2222
fetch-depth: 2
@@ -34,7 +34,7 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
37+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3838
with:
3939
ref: ${{ github.event.pull_request.head.ref }}
4040
fetch-depth: 2
@@ -67,7 +67,7 @@ jobs:
6767
runs-on: ubuntu-latest
6868
steps:
6969
- name: Checkout
70-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
70+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
7171
with:
7272
ref: ${{ github.event.pull_request.head.ref }}
7373
fetch-depth: 2

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2
1818
)"
1919
- name: Checkout
20-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
2121
with:
2222
ref: ${{ github.event.pull_request.head.sha }}
2323
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
@@ -49,7 +49,7 @@ jobs:
4949
jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2
5050
)"
5151
- name: Checkout
52-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
52+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
5353
with:
5454
ref: ${{ github.event.pull_request.head.sha }}
5555
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
@@ -86,7 +86,7 @@ jobs:
8686
jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2
8787
)"
8888
- name: Checkout
89-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
89+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
9090
with:
9191
ref: ${{ github.event.pull_request.head.sha }}
9292
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0

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

Lines changed: 3 additions & 3 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
14+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
1515
with:
1616
ref: ${{ github.event.pull_request.head.ref }}
1717
fetch-depth: 2
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
2828
with:
2929
ref: ${{ github.event.pull_request.head.ref }}
3030
fetch-depth: 2
@@ -44,7 +44,7 @@ jobs:
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Checkout
47-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
47+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
4848
with:
4949
ref: ${{ github.event.pull_request.head.ref }}
5050
fetch-depth: 2

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
31+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3232
with:
3333
ref: ${{ github.event.pull_request.head.ref }}
3434
fetch-depth: 2
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- name: Checkout
50-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
50+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
5151
with:
5252
ref: ${{ github.event.pull_request.head.ref }}
5353
fetch-depth: 2
@@ -82,7 +82,7 @@ jobs:
8282
runs-on: ubuntu-latest
8383
steps:
8484
- name: Checkout
85-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
85+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
8686
with:
8787
ref: ${{ github.event.pull_request.head.ref }}
8888
fetch-depth: 2

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
2727
with:
2828
ref: ${{ github.event.pull_request.head.ref }}
2929
fetch-depth: 2
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Checkout
45-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
45+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
4646
with:
4747
ref: ${{ github.event.pull_request.head.ref }}
4848
fetch-depth: 2
@@ -63,7 +63,7 @@ jobs:
6363
runs-on: ubuntu-latest
6464
steps:
6565
- name: Checkout
66-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
66+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
6767
with:
6868
ref: ${{ github.event.pull_request.head.ref }}
6969
fetch-depth: 2

.github/workflows/immediate-response.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ on:
1111
- opened
1212
jobs:
1313
respond-to-issue:
14-
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' }}
14+
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' &&
15+
github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' &&
16+
github.repository == 'integrations/terraform-provider-github' }}
1517
runs-on: ubuntu-latest
1618
steps:
1719
- name: Determine issue or PR number

0 commit comments

Comments
 (0)