| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2982f20 commit e8d2538
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,6 +46,18 @@ Lint a project's CI configuration:: | |||
| 46 | 46 | assert lint_result.valid is True # Test that the .gitlab-ci.yml is valid | |
| 47 | 47 | print(lint_result.merged_yaml) # Print the merged YAML file | |
| 48 | 48 | ||
| 49 | + Lint a project's CI configuration from a specific branch or tag:: | ||
| 50 | + | ||
| 51 | + lint_result = project.ci_lint.get(content_ref="main") | ||
| 52 | + assert lint_result.valid is True # Test that the .gitlab-ci.yml is valid | ||
| 53 | + print(lint_result.merged_yaml) # Print the merged YAML file | ||
| 54 | + | ||
| 55 | + Lint a project's CI configuration with dry run simulation:: | ||
| 56 | + | ||
| 57 | + lint_result = project.ci_lint.get(dry_run=True, dry_run_ref="develop") | ||
| 58 | + assert lint_result.valid is True # Test that the .gitlab-ci.yml is valid | ||
| 59 | + print(lint_result.merged_yaml) # Print the merged YAML file | ||
| 60 | + | ||
| 49 | 61 | Lint a CI YAML configuration with a namespace:: | |
| 50 | 62 | ||
| 51 | 63 | lint_result = project.ci_lint.create({"content": gitlab_ci_yml}) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,7 +51,14 @@ class ProjectCiLintManager( | |||
| 51 | 51 | _path = "/projects/{project_id}/ci/lint" | |
| 52 | 52 | _obj_cls = ProjectCiLint | |
| 53 | 53 | _from_parent_attrs = {"project_id": "id"} | |
| 54 | - _optional_get_attrs = ("dry_run", "include_jobs", "ref") | ||
| 54 | + _optional_get_attrs = ( | ||
| 55 | + "content_ref", | ||
| 56 | + "dry_run", | ||
| 57 | + "dry_run_ref", | ||
| 58 | + "include_jobs", | ||
| 59 | + "ref", | ||
| 60 | + ) | ||
| 61 | + | ||
| 55 | 62 | _create_attrs = RequiredOptional( | |
| 56 | 63 | required=("content",), optional=("dry_run", "include_jobs", "ref") | |
| 57 | 64 | ) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments