Skip to content

Commit fc1e4e9

Browse files
committed
aaa
Signed-off-by: Steve Hipwell <[email protected]>
1 parent a5dc46e commit fc1e4e9

4 files changed

Lines changed: 23 additions & 16 deletions

File tree

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ jobs:
3737
- name: Checkout
3838
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3939

40-
- name: Check secrets
41-
env:
42-
INPUT_ALLOWED_SECRETS: ${{ vars.DOTCOM_ACCEPTANCE_TESTS_ALLOWED_SECRETS || 'DOTCOM_TEST_USER_TOKEN' }}
43-
INPUT_SECRETS: ${{ toJSON(secrets) }}
44-
run: |
45-
set -eou pipefail
40+
# - name: Check secrets
41+
# env:
42+
# INPUT_ALLOWED_SECRETS: ${{ vars.DOTCOM_ACCEPTANCE_TESTS_ALLOWED_SECRETS || 'DOTCOM_TEST_USER_TOKEN' }}
43+
# INPUT_SECRETS: ${{ toJSON(secrets) }}
44+
# run: |
45+
# set -eou pipefail
4646

47-
secret_keys="$(jq --raw-output --compact-output '[. | keys[] | select(test("^(?:(?:TEST)|(?:test))_") | not)] | sort | join(",")' <<<"${INPUT_SECRETS}")"
48-
if [[ "${secret_keys}" != "${INPUT_ALLOWED_SECRETS}" ]]; then
49-
echo "::error::Too many or too few secrets configured: ${secret_keys}"
50-
exit 1
51-
fi
47+
# secret_keys="$(jq --raw-output --compact-output '[. | keys[] | select(test("^(?:(?:ACTIONS)|(?:actions)|(?:GITHUB)|(?:github)|(?:TEST)|(?:test))_") | not)] | sort | join(",")' <<<"${INPUT_SECRETS}")"
48+
# if [[ "${secret_keys}" != "${INPUT_ALLOWED_SECRETS}" ]]; then
49+
# echo "::error::Too many or too few secrets configured: ${secret_keys}"
50+
# exit 1
51+
# fi
5252

5353
- name: Check credentials
5454
id: credentials
@@ -75,14 +75,15 @@ jobs:
7575
env:
7676
TF_ACC: "1"
7777
TF_LOG: INFO
78+
GITHUB_TOKEN: ${{ steps.credentials.outputs.token }}
7879
GITHUB_BASE_URL: https://api.github.com/
7980
GITHUB_TEST_TYPE: ${{ matrix.mode }}
8081
GITHUB_OWNER: ${{ (matrix.mode == 'individual' && 'github-terraform-test-user') || (matrix.mode == 'organization' && 'terraformtesting') || '' }}
8182
GITHUB_ORGANIZATION: ${{ (matrix.mode == 'organization' && 'terraformtesting') || '' }}
8283
GITHUB_TEST_ORGANIZATION: ${{ (matrix.mode == 'individual' && 'terraformtesting') || '' }}
8384
GITHUB_TEST_OWNER: ${{ (matrix.mode == 'organization' && 'github-terraform-test-user') || '' }}
8485
GITHUB_TEST_USER_TOKEN: ${{ steps.credentials.outputs.token }}
85-
run: go test -run "^TestAcc*" ./github -v -race -coverprofile=coverage.txt -covermode=atomic -sweep=tf-acc- -timeout 120m -count=1
86+
run: go test -run "^TestAcc*" ./github -v -race -coverprofile=coverage.txt -covermode=atomic -timeout 120m -count=1
8687

8788
check:
8889
name: Check DotCom Acceptance Tests

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
set -eou pipefail
3838
39-
secret_keys="$(jq --raw-output --compact-output '[. | keys[] | select(test("^(?:(?:TEST)|(?:test))_") | not)] | sort | join(",")' <<<"${INPUT_SECRETS}")"
39+
secret_keys="$(jq --raw-output --compact-output '[. | keys[] | select(test("^(?:(?:ACTIONS)|(?:actions)|(?:GITHUB)|(?:github)|(?:TEST)|(?:test))_") | not)] | sort | join(",")' <<<"${INPUT_SECRETS}")"
4040
if [[ "${secret_keys}" != "${INPUT_ALLOWED_SECRETS}" ]]; then
4141
echo "::error::Too many or too few secrets configured: ${secret_keys}"
4242
exit 1
@@ -89,12 +89,13 @@ jobs:
8989
env:
9090
TF_ACC: "1"
9191
TF_LOG: INFO
92+
GITHUB_TOKEN: ${{ steps.credentials.outputs.token }}
9293
GITHUB_BASE_URL: ${{ steps.server.outputs.address }}
9394
GITHUB_TEST_TYPE: enterprise
9495
GITHUB_OWNER: terraformtesting
9596
GITHUB_ORGANIZATION: terraformtesting
9697
GITHUB_TEST_USER_TOKEN: ${{ steps.credentials.outputs.token }}
97-
run: go test -run "^TestAcc*" ./github -v -race -coverprofile=coverage.txt -covermode=atomic -sweep=tf-acc- -timeout 120m -count=1
98+
run: go test -run "^TestAcc*" ./github -v -race -coverprofile=coverage.txt -covermode=atomic -timeout 120m -count=1
9899

99100
check:
100101
name: Check GHES Acceptance Tests

github/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (c *Config) NewRESTClient(client *http.Client) (*github.Client, error) {
103103

104104
hostname := uv3.Hostname()
105105
if hostname != DotComHost && !GHECDataResidencyHostMatch.MatchString(hostname) {
106-
uv3.Path = path.Join(uv3.Path, "api/v3/")
106+
uv3.Path = path.Join(uv3.Path, "api/v3") // fmt.Sprintf("%s/", path.Join(uv3.Path, "api/v3"))
107107
}
108108

109109
v3client, err := github.NewClient(client).WithEnterpriseURLs(uv3.String(), "")

github/sweeper_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ func sharedConfigForRegion() (any, error) {
2121
return nil, fmt.Errorf("empty GITHUB_OWNER")
2222
}
2323

24+
baseURL, ok := os.LookupEnv("GITHUB_BASE_URL")
25+
if !ok {
26+
baseURL = "https://api.github.com/"
27+
}
28+
2429
config := Config{
2530
Token: os.Getenv("GITHUB_TOKEN"),
2631
Owner: os.Getenv("GITHUB_OWNER"),
27-
BaseURL: "",
32+
BaseURL: baseURL,
2833
}
2934

3035
meta, err := config.Meta()

0 commit comments

Comments
 (0)