Skip to content

Commit 91f7e26

Browse files
authored
Merge branch 'main' into main
2 parents 4d671f6 + c917477 commit 91f7e26

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.github/workflows/immediate-response.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: echo "NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
1919

2020
- name: Respond to issue or PR
21-
uses: peter-evans/create-or-update-comment@1f6c51492b7d8e91122ece56e2eb7ed38df14079
21+
uses: peter-evans/create-or-update-comment@46da6c0d98504aed6fc429519a258b951f23f474
2222
with:
2323
issue-number: ${{ steps.extract.outputs.NUMBER }}
2424
body: >

github/provider.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,13 @@ func providerConfigure(p *schema.Provider) schema.ConfigureFunc {
338338
token = appToken
339339
}
340340

341+
isGithubDotCom, err := regexp.MatchString("^"+regexp.QuoteMeta("https://api.github.com"), baseURL)
342+
if err != nil {
343+
return nil, err
344+
}
345+
341346
if token == "" {
342-
ghAuthToken, err := tokenFromGhCli(baseURL)
347+
ghAuthToken, err := tokenFromGhCli(baseURL, isGithubDotCom)
343348
if err != nil {
344349
return nil, fmt.Errorf("gh auth token: %w", err)
345350
}
@@ -359,11 +364,7 @@ func providerConfigure(p *schema.Provider) schema.ConfigureFunc {
359364
log.Printf("[DEBUG] Setting read_delay_ms to %d", readDelay)
360365

361366
parallelRequests := d.Get("parallel_requests").(bool)
362-
isGithubDotCom, err := regexp.MatchString("^"+regexp.QuoteMeta("https://api.github.com"), baseURL)
363367

364-
if err != nil {
365-
return nil, err
366-
}
367368
if parallelRequests && isGithubDotCom {
368369
return nil, fmt.Errorf("parallel_requests cannot be true when connecting to public github")
369370
}
@@ -391,13 +392,13 @@ func providerConfigure(p *schema.Provider) schema.ConfigureFunc {
391392
}
392393

393394
// See https://github.com/integrations/terraform-provider-github/issues/1822
394-
func tokenFromGhCli(baseURL string) (string, error) {
395+
func tokenFromGhCli(baseURL string, isGithubDotCom bool) (string, error) {
395396
ghCliPath := os.Getenv("GH_PATH")
396397
if ghCliPath == "" {
397398
ghCliPath = "gh"
398399
}
399400
hostname := ""
400-
if baseURL == "" {
401+
if isGithubDotCom {
401402
hostname = "github.com"
402403
} else {
403404
parsedURL, err := url.Parse(baseURL)

website/docs/d/branch.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The following arguments are supported:
2424

2525
* `repository` - (Required) The GitHub repository name.
2626

27-
* `branch` - (Required) The repository branch to create.
27+
* `branch` - (Required) The repository branch to retrieve.
2828

2929
## Attribute Reference
3030

0 commit comments

Comments
 (0)