#!/usr/bin/perl -w use strict; use warnings; my $is_forced = 0; my @translations; if(defined($ENV{WEBWML_FORCE_TRANSLATIONS})) { @translations = split(' ', $ENV{WEBWML_FORCED_TRANSLATIONS}); } else { if($ENV{CI_COMMIT_MESSAGE} =~ /force translations:(.*)/i) { @translations = split(' ', $1); } } if(scalar(grep(/$ENV{CI_JOB_NAME}/, @translations)) > 0) { exit 0; } if(scalar(@translations) > 0 && $translations[0] eq 'all') { exit 0; } open GIT, "git log -p \$CI_COMMIT_BEFORE_SHA..HEAD|diffstat -p1 -l|"; while() { next unless /\//; my @dirparts = split(/\//); if($dirparts[0] eq $ENV{CI_JOB_NAME}) { close GIT; exit 0; } } close GIT; exit 1;