diff options
Diffstat (limited to 'lib/gitlab/ci/lint.rb')
-rw-r--r-- | lib/gitlab/ci/lint.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/ci/lint.rb b/lib/gitlab/ci/lint.rb index fb795152abe..364e67db02b 100644 --- a/lib/gitlab/ci/lint.rb +++ b/lib/gitlab/ci/lint.rb @@ -18,9 +18,10 @@ module Gitlab end end - def initialize(project:, current_user:) + def initialize(project:, current_user:, sha: nil) @project = project @current_user = current_user + @sha = sha || project.repository.commit.sha end def validate(content, dry_run: false) @@ -51,7 +52,7 @@ module Gitlab content, project: @project, user: @current_user, - sha: @project.repository.commit.sha + sha: @sha ).execute Result.new( @@ -99,7 +100,8 @@ module Gitlab except: job[:except], environment: job[:environment], when: job[:when], - allow_failure: job[:allow_failure] + allow_failure: job[:allow_failure], + needs: job.dig(:needs_attributes) } end end |