Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/resolvers/ci/config_resolver.rb')
-rw-r--r--app/graphql/resolvers/ci/config_resolver.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/graphql/resolvers/ci/config_resolver.rb b/app/graphql/resolvers/ci/config_resolver.rb
index 252c9d3acf0..f2e33251b9c 100644
--- a/app/graphql/resolvers/ci/config_resolver.rb
+++ b/app/graphql/resolvers/ci/config_resolver.rb
@@ -18,6 +18,10 @@ module Resolvers
required: true,
description: 'The project of the CI config.'
+ argument :sha, GraphQL::STRING_TYPE,
+ required: false,
+ description: "Sha for the pipeline."
+
argument :content, GraphQL::STRING_TYPE,
required: true,
description: "Contents of `.gitlab-ci.yml`."
@@ -26,11 +30,11 @@ module Resolvers
required: false,
description: 'Run pipeline creation simulation, or only do static check.'
- def resolve(project_path:, content:, dry_run: false)
+ def resolve(project_path:, content:, sha: nil, dry_run: false)
project = authorized_find!(project_path: project_path)
result = ::Gitlab::Ci::Lint
- .new(project: project, current_user: context[:current_user])
+ .new(project: project, current_user: context[:current_user], sha: sha)
.validate(content, dry_run: dry_run)
response(result).merge(merged_yaml: result.merged_yaml)