Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
run: make build-all
code_coverage:
name: Code coverage report
if: github.event_name == 'pull_request'
needs:
- test
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions internal/ghworkflow/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ type job struct {
// The name of the job displayed on GitHub.
Name string `yaml:"name,omitempty"`

// You can use the if conditional to prevent a step from running unless a condition is met.
If string `yaml:"if,omitempty"`

// List of <job_id> that must complete successfully before this job will run.
Needs []string `yaml:"needs,omitempty"`

Expand Down
1 change: 1 addition & 0 deletions internal/ghworkflow/workflow_ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func ciWorkflow(cfg core.Configuration, sr golang.ScanResult) {

// see https://github.com/fgrosse/go-coverage-report#usage
codeCov := baseJob("Code coverage report", cfg.GitHubWorkflow)
codeCov.If = "github.event_name == 'pull_request'"
codeCov.Needs = []string{"test"}
codeCov.Permissions = permissions{
Contents: "read",
Expand Down
Loading