Skip to content

Commit 74bde01

Browse files
committed
Update to internal_publish_base_url
1 parent dbafa32 commit 74bde01

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ inputs:
3737
required: false
3838
default: false
3939

40-
publish_base_url:
40+
internal_publish_base_url:
4141
description: "INPUT: Base URL for publishing results. Used for testing."
4242
required: false
4343
default: "https://api.securityscorecards.dev"

options/env.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ const (
3838

3939
// TODO(input): INPUT_ constants should be removed in a future release once
4040
// they have replacements in upstream scorecard.
41-
EnvInputRepoToken = "INPUT_REPO_TOKEN" //nolint:gosec
42-
EnvInputInternalRepoToken = "INPUT_INTERNAL_DEFAULT_TOKEN" //nolint:gosec
43-
EnvInputResultsFile = "INPUT_RESULTS_FILE"
44-
EnvInputResultsFormat = "INPUT_RESULTS_FORMAT"
45-
EnvInputPublishResults = "INPUT_PUBLISH_RESULTS"
46-
EnvInputPublishBaseURL = "INPUT_PUBLISH_BASE_URL"
41+
EnvInputRepoToken = "INPUT_REPO_TOKEN" //nolint:gosec
42+
EnvInputInternalRepoToken = "INPUT_INTERNAL_DEFAULT_TOKEN" //nolint:gosec
43+
EnvInputResultsFile = "INPUT_RESULTS_FILE"
44+
EnvInputResultsFormat = "INPUT_RESULTS_FORMAT"
45+
EnvInputPublishResults = "INPUT_PUBLISH_RESULTS"
46+
EnvInputInternalPublishBaseURL = "INPUT_INTERNAL_PUBLISH_BASE_URL"
4747
)
4848

4949
// Errors

signing/signing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func ProcessSignature(jsonPayload []byte, repoName, repoRef, accessToken string)
106106

107107
// Call scorecard-webapp-api to process and upload signature.
108108
// Setup HTTP request and context.
109-
apiURL := os.Getenv(options.EnvInputPublishBaseURL)
109+
apiURL := os.Getenv(options.EnvInputInternalPublishBaseURL)
110110
rawURL := fmt.Sprintf("%s/projects/github.com/%s", apiURL, repoName)
111111
parsedURL, err := url.Parse(rawURL)
112112
if err != nil {

signing/signing_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package signing
1919
import (
2020
"os"
2121
"testing"
22+
23+
"github.com/ossf/scorecard-action/options"
2224
)
2325

2426
// TODO: For this test to work, fake the OIDC token retrieval with something like.
@@ -80,7 +82,7 @@ func Test_ProcessSignature(t *testing.T) {
8082
repoName := "ossf-tests/scorecard-action"
8183
repoRef := "refs/heads/main"
8284
accessToken := os.Getenv("GITHUB_AUTH_TOKEN")
83-
os.Setenv("INPUT_PUBLISH_BASE_URL", "https://api.securityscorecards.dev")
85+
os.Setenv(options.EnvInputInternalPublishBaseURL, "https://api.securityscorecards.dev")
8486

8587
if err != nil {
8688
t.Errorf("Error reading testdata:, %v", err)

0 commit comments

Comments
 (0)