Skip to content

Commit

Permalink
feat: add more scan context for gitlab
Browse files Browse the repository at this point in the history
  • Loading branch information
gotbadger committed Jan 12, 2024
1 parent 49c6944 commit 973a7ae
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/flag/repository_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ var (
Value: "",
Usage: "Used when fetching branch level ignores for a PR/MR",
EnvironmentVariables: []string{
"PR_NUMBER", // github
"CI_MERGE_REQUEST_ID", //gitlab
"PR_NUMBER", // github
"CI_MERGE_REQUEST_IID", //gitlab
},
DisableInConfig: true,
Hide: true,
Expand Down
4 changes: 2 additions & 2 deletions internal/flag/repository_flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ func Test_getPullRequestNumberFlag(t *testing.T) {
},
},
{
name: "Repository PullRequestNumber. CI_MERGE_REQUEST_ID env",
name: "Repository PullRequestNumber. CI_MERGE_REQUEST_IID env",
flag: PullRequestNumberFlag,
env: Env{
key: "CI_MERGE_REQUEST_ID",
key: "CI_MERGE_REQUEST_IID",
value: "24",
},
want: []string{
Expand Down
1 change: 1 addition & 0 deletions internal/report/output/saas/saas.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,6 @@ func getMeta(
BearerVersion: build.Version,
FoundLanguages: reportData.FoundLanguages,
GitlabPipelineId: os.Getenv("CI_PIPELINE_ID"),
GitlabJobId: os.Getenv("CI_JOB_ID"),
}, nil
}
1 change: 1 addition & 0 deletions internal/report/output/saas/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Meta struct {
BearerVersion string `json:"bearer_version,omitempty" yaml:"bearer_version,omitempty"`
FoundLanguages map[string]int32 `json:"found_languages" yaml:"found_languages"`
GitlabPipelineId string `json:"gitlab_pipeline_id,omitempty" yaml:"gitlab_pipeline_id,omitempty"`
GitlabJobId string `json:"gitlab_job_id,omitempty" yaml:"gitlab_job_id,omitempty"`
}

type BearerReport struct {
Expand Down

0 comments on commit 973a7ae

Please sign in to comment.