Skip to content
Snippets Groups Projects

Add logic to skip project wikis

Merged Martin Lowe requested to merge (removed):malowe/master/wiki-skip into master
All threads resolved!
1 file
+ 8
0
Compare changes
  • Side-by-side
  • Inline
+ 8
0
@@ -4,6 +4,7 @@
require 'json'
require 'httparty'
require 'multi_json'
+1
WIKI_REGEX_MATCH = /.*\.wiki$/
## Process the commit into a hash object that will be posted to the ECA validation service
def process_commit(sha)
@@ -48,6 +49,13 @@ new_head_commit = stdin_args[1]
## Get the project ID from env var, extracting from pattern 'project-###'
project_id = ENV['GL_REPOSITORY'][8..-1]
project_path = ENV['GL_PROJECT_PATH']
## Check if current repo is a project wiki (no project ID and ends in .wiki)
if (project_id.nil? && project_path =~ WIKI_REGEX_MATCH) then
puts "Repository is a project wiki and not bound by ECA, skipping"
exit 0
end
## Get data about project from API
project_response = HTTParty.get("https://gitlab.eclipse.org/api/v4/projects/#{project_id}",
:headers => {
Loading