Skip to content
Snippets Groups Projects

Support for release key in gitlab-ci.yaml

Merged Sean Carroll requested to merge 26013-release-generation-from-within-gitlab-ci-yml-2 into master
All threads resolved!
3 files
+ 70
9
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -19,7+19,7 @@
environment coverage retry parallel extends interruptible release timeout].freeze
REQUIRED_BY_NEEDS = %i[stage].freeze
validations do
validates :config, type: Hash
validates :config, allowed_keys: ALLOWED_KEYS
@@ -34,7+34,7 @@
message: 'key may not be used with `rules`'
},
if: :has_rules?
validates :config,
required_keys: {
in: %i[only],
message: '`only: tags` must be specified with $CI_COMMIT_TAG'
},
if: :has_commit_tag?
with_options allow_nil: true do
validates :allow_failure, boolean: true
@@ -208,6 +214,10 @@ def has_rules?
@config.try(:key?, :rules)
end
def has_commit_tag?
@config.try(:key?, :release) && @config[:release][:tag_name] == '$CI_COMMIT_TAG'
end
def ignored?
allow_failure.nil? ? manual_action? : allow_failure
end
Loading