blob: 11977bee3122183f140e6778ef7f84db7a98cc2d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/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(<GIT>) {
next unless /\//;
my @dirparts = split(/\//);
if($dirparts[0] eq $ENV{CI_JOB_NAME}) {
close GIT;
exit 0;
}
}
close GIT;
exit 1;
|