Skip to content

Commit b8df27e

Browse files
authored
fix: remove code check dependency for ci check (#144)
This change closes #143 by updating the evaluation logic to remove any check on the contents of the repository beyond those contents in `.github/workflows` This is a bit of subtle bug in that the control's result remains the same, but the underlying reason changes when the control is run against a repository that has no workflows in `.github/workflows` This change was tested and produced the result: ```yaml - requirement-id: OSPS-BR-01.01 applicability: - Maturity Level 1 - Maturity Level 2 - Maturity Level 3 description: When a CI/CD pipeline accepts an input parameter, that parameter MUST be sanitized and validated prior to use in the pipeline. result: Passed message: "content not found at .github/workflows: directory '.github' not found in path '.github/workflows'" steps: - github.com/revanite-io/pvtr-github-repo/evaluation_plans/osps/build_release.cicdSanitizedInputParameters steps-executed: 1 ``` Signed-off-by: Travis Truman <trumant@gmail.com>
1 parent be60dc3 commit b8df27e

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

evaluation_plans/osps/build_release/evaluations.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ func OSPS_BR_01() (evaluation *layer4.ControlEvaluation) {
2222
"Maturity Level 3",
2323
},
2424
[]layer4.AssessmentStep{
25-
reusable_steps.IsCodeRepo,
2625
cicdSanitizedInputParameters,
2726
},
2827
)

evaluation_plans/osps/build_release/steps.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ func cicdSanitizedInputParameters(payloadData any, _ map[string]*layer4.Change)
4040
if message != "" {
4141
return layer4.Unknown, message
4242
}
43-
if !data.IsCodeRepo {
44-
return layer4.NotApplicable, "Repository contains no code - skipping CI/CD checks"
45-
}
46-
4743
workflows, err := data.GetDirectoryContent(".github/workflows")
4844
if len(workflows) == 0 {
4945
if err != nil {

0 commit comments

Comments
 (0)