Fix adding extra characters for pipeline execution policy
What does this MR do and why?
This MR fixes adding extra characters
Extra characters were added when yaml is parsed for scan execution policy for ci/cd action
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Description | Video |
---|---|
Editing yaml in editor and loading from file
|
Loom video |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Enable feature flag
Feature.enable(:compliance_pipeline_in_policies)
-
Create a group
-
Go to Settings -> General
-
Toggle the Permissions and group features section
-
Enable Run customized CI YAML file as security policy actions
-
Go to Secure -> Policies
-
Select New policy
-
Select Scan execution policy
-
Select Add new action
-
Select Run CI/CD code
-
Past the following code:
test job: stage: test
-
Observe that the YAML section on the right side contains:
ci_configuration: | |- test job: stage: test
The correct YAML would be:
ci_configuration: |-
test job:
stage: test
- Create yaml file locally with same content
- Use load from file option and load content from created file
Related to #439346 (closed)