]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
add github workflow test
authorAilin Nemui <redacted>
Mon, 25 Jan 2021 18:42:25 +0000 (19:42 +0100)
committerAilin Nemui <redacted>
Mon, 25 Jan 2021 23:15:28 +0000 (00:15 +0100)
15 files changed:
.github/actions.yml [deleted file]
.github/main.workflow [deleted file]
.github/workflows/test.yml [new file with mode: 0644]
_testing/_irssi_test.pl
_testing/config.yml
_testing/github/_get_files_arr.zsh
_testing/github/commit-scripts-yaml.zsh
_testing/github/extract-artefacts.zsh
_testing/github/show-failures.zsh
_testing/report-test.zsh
_testing/run-test.zsh
_testing/travis/_get_files_arr.zsh
_testing/travis/show-failures.zsh
_testing/update-scripts-yaml.pl
_tools/add_script_vote_comment.pl

diff --git a/.github/actions.yml b/.github/actions.yml
deleted file mode 100644 (file)
index cb88d59..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-addons:
-  apt:
-    packages:
-    # irssi build dependencies
-    - elinks
-    # script test dependencies
-    - zsh
-    # script dependencies
-    - libdb-dev
-    - libaspell-dev
-    - libgirepository1.0-dev
-    - gobject-introspection
-    - gir1.2-notify-0.7 # for desktop-notify
-    - xosd-bin # for osd
-before_install:
-  - wget -nv https://download.opensuse.org/repositories/home:ailin_nemui:irssi-git/Debian_9.0/Release.key -O- | apt-key add -
-  - echo 'deb http://download.opensuse.org/repositories/home:/ailin_nemui:/irssi-git/Debian_9.0/ /' > /etc/apt/sources.list.d/irssi_obs.list
-  - apt-get update -q && apt-get install -y irssi-git
-install:
-  - |
-    if [ "${USE_ARTEFACTS_CACHE:-no}" = yes ] && [ "${EXTRACT_TEST_ARTEFACTS:-no}" = yes ]; then
-      ./_testing/github/load-old-artefacts.zsh
-    fi
-  - ./_testing/autoinstall-perl-prereqs.zsh
-  - cpanm --quiet --installdeps --notest ./auto
-before_script:
-  - ./_testing/run-test.zsh
-  - |
-    if [ "${GITHUB_REF:-}" != refs/heads/master ]; then
-      git diff --stat origin/master
-    fi
-script:
-  - ./_testing/report-test.zsh || rc=$?
-  - echo ${rc:-0} > $HOME/script-rc
-after_script:
-  - ./_testing/github/show-failures.zsh
-  - |
-    if [ "${GITHUB_REF:-}" = refs/heads/master ] && [ -n "${GITHUB_TOKEN:-}" ]; then
-      perl ./_testing/update-scripts-yaml.pl
-      ./_testing/github/commit-scripts-yaml.zsh
-    fi
-  - |
-    if [ "${GITHUB_REF:-}" = refs/heads/master ] && [ -n "${GITHUB_TOKEN:-}" ] && [ "${EXTRACT_TEST_ARTEFACTS:-no}" = yes ]; then
-      ./_testing/github/extract-artefacts.zsh
-    fi
-  - cat /github/home/.git-credential-helper
-script_result:
-  - (exit "$(cat $HOME/script-rc)")
-global_env:
-  - export LANG=C.UTF-8
-  - export USE_ARTEFACTS_CACHE=yes
-  - export EXTRACT_TEST_ARTEFACTS=yes
diff --git a/.github/main.workflow b/.github/main.workflow
deleted file mode 100644 (file)
index 0001264..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# workflow "Check Scripts(M)" {
-#   on = "push"
-#   resolves = ["update-scripts"]
-# }
-
-# workflow "Check Scripts" {
-#   on = "push"
-#   resolves = ["result"]
-# }
-
-action "On Master Branch" {
-  uses = "actions/bin/filter@master"
-  args = "branch master"
-}
-
-action "On Pull Request" {
-  uses = "actions/bin/filter@master"
-  args = "not branch master"
-}
-
-action "run-test(m)" {
-  uses = "irssi-import/actions-irssi/check-irssi-scripts@master"
-  needs = ["On Master Branch"]
-  args = "before_install global_env install before_script"
-}
-
-action "run-test" {
-  uses = "irssi-import/actions-irssi/check-irssi-scripts@master"
-  needs = ["On Pull Request"]
-  args = "before_install global_env install before_script"
-}
-
-action "report-test" {
-  uses = "irssi-import/actions-irssi/check-irssi-scripts@master"
-  needs = ["run-test"]
-  args = "global_env script"
-}
-
-action "report-test(m)" {
-  uses = "irssi-import/actions-irssi/check-irssi-scripts@master"
-  needs = ["run-test(m)"]
-  args = "global_env script"
-}
-
-action "update-scripts" {
-  uses = "irssi-import/actions-irssi/check-irssi-scripts@master"
-  needs = ["report-test(m)"]
-  args = "global_env after_script"
-  secrets = ["GITHUB_TOKEN"]
-}
-
-action "show-failures" {
-  uses = "irssi-import/actions-irssi/check-irssi-scripts@master"
-  needs = ["report-test"]
-  args = "global_env after_script"
-}
-
-action "result" {
-  uses = "irssi-import/actions-irssi/check-irssi-scripts@master"
-  needs = ["show-failures"]
-  args = "global_env script_result"
-}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644 (file)
index 0000000..4de60a0
--- /dev/null
@@ -0,0 +1,96 @@
+on:
+  push:
+    branches:
+     - master
+  pull_request:
+name: Check Script
+env:
+  apt_build_deps: irssi-git cpanminus elinks zsh
+  apt_script_deps: libdb-dev libaspell-dev libgirepository1.0-dev gobject-introspection gir1.2-notify-0.7 xosd-bin wbritish
+  USE_ARTEFACTS_CACHE: yes
+  EXTRACT_TEST_ARTEFACTS: yes
+  PERL_MM_NONINTERACTIVE: 1
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@main
+      - uses: mstachniuk/ci-skip@v1
+        with:
+          fail-fast: true
+      - name: prepare required software
+        run: |
+          RELEASE=$(lsb_release -rs)
+          echo "deb http://download.opensuse.org/repositories/home:/ailin_nemui:/irssi-git/xUbuntu_$RELEASE/ /" | sudo tee /etc/apt/sources.list.d/home:ailin_nemui:irssi-git.list
+          curl -fsSL https://download.opensuse.org/repositories/home:ailin_nemui:irssi-git/xUbuntu_$RELEASE/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_ailin_nemui_irssi-git.gpg > /dev/null
+          sudo apt -q update
+          sudo apt -q install $apt_build_deps $apt_script_deps
+      - name: cache cpan
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/extlib
+          key: ${{ runner.os }}-cpan-${{ github.sha }}-${{ github.run_number }}
+          restore-keys: |
+            ${{ runner.os }}-cpan-${{ github.sha }}-
+            ${{ runner.os }}-cpan-
+      - name: fetch origin master branch
+        if: ${{ github.event_name == 'pull_request' }}
+        run: |
+          git fetch --depth=1 origin refs/heads/master
+      - name: configure local::lib
+        run: |
+          eval $(perl -Mlocal::lib="$HOME"/extlib)
+          for v in PATH PERL5LIB PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT; do
+            eval echo "\$v=\$$v" >> $GITHUB_ENV
+          done
+      - name: fix the broken Encode module
+        run: |
+          cpanm Encode
+      - name: load old artefacts
+        if: ${{ env.USE_ARTEFACTS_CACHE == 'yes' }}
+        run:
+          ./_testing/github/load-old-artefacts.zsh
+      - name: install cpan dependencies
+        run: |
+          cpanm --installdeps --notest .
+          ./_testing/autoinstall-perl-prereqs.zsh
+      - name: auto-install cpan script dependencies
+        run: |
+          pushd auto
+          cpanm --quiet --installdeps --notest .
+          popd
+      - name: run tests
+        run: |
+          ./_testing/run-test.zsh
+      - name: show diffstat
+        if: ${{ github.event_name == 'pull_request' }}
+        run: |
+          git diff --stat origin/master
+      - name: test report
+        run: |
+          ./_testing/report-test.zsh || rc=$?
+          echo "SCRIPT_RC=${rc:-0}" >> $GITHUB_ENV
+      - name: integration report
+        run: |
+          ./_testing/github/show-failures.zsh
+      - name: update scripts.yaml
+        if: ${{ github.event_name == 'push' }}
+        run: |
+          perl ./_testing/update-scripts-yaml.pl
+      - name: commit scripts.yaml
+        if: ${{ github.event_name == 'push' }}
+        run: |
+          ./_testing/github/commit-scripts-yaml.zsh
+      - uses: actions/checkout@main
+        if: ${{ github.event_name == 'push' && env.EXTRACT_TEST_ARTEFACTS == 'yes' }}
+        with:
+          ref: ci-artefacts
+          path: artefacts
+      - name: extract artefacts
+        if: ${{ github.event_name == 'push' && env.EXTRACT_TEST_ARTEFACTS == 'yes' }}
+        run: |
+          ./_testing/github/extract-artefacts.zsh
+      - name: end
+        run: |
+          exit $SCRIPT_RC
index 572d2709d04c05e054f0a0ad7561eeb027679b3a..c29cb7cd9a37419fd6d7c745b51f38de5380fb08 100644 (file)
@@ -3,8 +3,8 @@ use warnings;
 
 BEGIN {
     *CORE::GLOBAL::exit = sub (;$) {
-       require Carp;
-       Carp::croak("script tried to call exit @_");
+        require Carp;
+        Carp::croak("script tried to call exit @_");
     };
 }
 
@@ -30,6 +30,7 @@ $Carp::MaxEvalLen = 3;
 require YAML::Tiny;
 YAML::Tiny->VERSION("1.59");
 require Encode;
+die "Broken Encode version (2.88)" if $Encode::VERSION eq '2.88';
 {
     # This is an ugly hack to be `lax' about the encoding. We try to
     # read everything as UTF-8 regardless of declared file encoding
@@ -37,11 +38,11 @@ require Encode;
     my $orig = YAML::Tiny->can("_has_internal_string_value") || die("Error in ".__PACKAGE__);
     no warnings 'redefine';
     *YAML::Tiny::_has_internal_string_value = sub {
-       my $ret = $orig->(@_);
-       use bytes;
-       $_[0] = Encode::decode_utf8($_[0], sub{pack 'U', +shift})
-           unless Encode::is_utf8($_[0]);
-       $ret
+        my $ret = $orig->(@_);
+        use bytes;
+        $_[0] = Encode::decode_utf8($_[0], sub{pack 'U', +shift})
+            unless Encode::is_utf8($_[0]);
+        $ret
     }
 }
 require Module::CoreList;
@@ -50,8 +51,8 @@ require Perl::PrereqScanner;
 my $prereq_results = Perl::PrereqScanner->new->scan_file("$SWD/scripts/$CURRENT_SCRIPT.pl");
 my @modules = grep {
     $_ ne 'perl' &&
-       $_ ne 'Irssi' && $_ ne 'Irssi::UI' && $_ ne 'Irssi::TextUI' && $_ ne 'Irssi::Irc'
-       && !Module::CoreList->first_release($_)
+        $_ ne 'Irssi' && $_ ne 'Irssi::UI' && $_ ne 'Irssi::TextUI' && $_ ne 'Irssi::Irc'
+        && !Module::CoreList->first_release($_)
 } sort keys %{ $prereq_results->as_string_hash };
 
 my (%info, $version, @commands);
index e8b9ee050cdf8df6333ea5f533f77c66450b0914..a91d4d412ac3a4b22b961e04cb8bbf37b6a84e77 100644 (file)
@@ -34,6 +34,7 @@ whitelist:
   - idonkey
   - ircgallery
   - isdn
+  - iMPD
   - ixmmsa
   - l33tmusic
   - log2ansi
index 384a9520c87dc1b2454e06180b823b7721c59f2c..03b397492d236c77da9a27c4405b31babe513b21 100644 (file)
@@ -5,7 +5,7 @@ if [[ $GITHUB_REF != refs/heads/master ]] {
     scriptfiles=($(git diff --numstat --no-renames origin/master|cut -f3|grep '^scripts/.*\.pl'))
     IFS=$OIFS
     if [[ $#scriptfiles -gt 0 ]] {
-       filelist=($scriptfiles)
+        filelist=($scriptfiles)
     }
 } \
 elif [[ $USE_ARTEFACTS_CACHE = yes ]] {
index 947655ed06655d6083ba1232824dbc93376721f6..3e9791f088ab5b11317aa51f2fcf5701dbb0f802 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/zsh
 
-[[ -z $GITHUB_TOKEN ]] && exit
+[[ -z $GITHUB_ACTION ]] && exit
 
 git config user.email "scripts@irssi.org"
 git config user.name "Irssi Scripts Helper"
@@ -12,7 +12,7 @@ if [[ "$(git log -1 --format=%an)" != "$(git config user.name)" &&
     git add _data/scripts.yaml
     git commit -m "automatic scripts database update for $GITHUB_SHA
 
-[skip ci]"
+[ci skip]"
     git config push.default simple
     git push --set-upstream origin master
 }
index f43f32ee9ad23d05597f321d46ab4fa505ab3940..be4bf5526bdeb32c9fe98059ae89fdeeed4dfd1c 100755 (executable)
@@ -1,15 +1,7 @@
 #!/bin/zsh
-if [[ -z $GITHUB_TOKEN || -z $GITHUB_REPOSITORY ]] { exit 1 }
+if [[ -z $GITHUB_REPOSITORY ]] { exit 1 }
 autoload -Uz zargs
 
-if { ! git clone -b ci-artefacts https://github.com/${GITHUB_REPOSITORY}.git artefacts } {
-    mkdir artefacts && git init artefacts
-    pushd artefacts
-    git remote add origin https://github.com/${GITHUB_REPOSITORY}.git
-    git checkout -b ci-artefacts
-    popd
-}
-
 pushd artefacts
 git config user.email "scripts@irssi.org"
 git config user.name "Irssi Scripts Helper"
@@ -34,6 +26,6 @@ if [[ $USE_ARTEFACTS_CACHE == yes ]] {
 git add .
 git commit -q -m "ci artefacts for $GITHUB_SHA
 
-[skip ci]"
+[ci skip]"
 
 git push -u origin ci-artefacts
index 95670fc2d126684fdb60496aab9258e717bb6fcb..50ef4ea279b2fb9979be19d7755b50e3fea9e375 100755 (executable)
@@ -7,21 +7,21 @@ if [[ $GITHUB_REF != refs/heads/master ]] {
     for scriptfile ($filelist) {
         echo '--- '$scriptfile:t
         if [[ -f "Test/${scriptfile:t:r}/failed.yml" ]] {
-           echo "FATAL: SCRIPT FAILED TO LOAD  "
-       }
+            echo "FATAL: SCRIPT FAILED TO LOAD  "
+        }
         cat "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null
         cat "Test/${scriptfile:t:r}/irssi.log"
-       echo
-       echo 'Source code critic:'
-       cat "Test/${scriptfile:t:r}/perlcritic.log"
-       echo
+        echo
+        echo 'Source code critic:'
+        cat "Test/${scriptfile:t:r}/perlcritic.log"
+        echo
     }
     echo
     echo '======== YAML DATABASE ========'
     for scriptfile ($filelist) {
         if [[ ! -f "Test/${scriptfile:t:r}/failed.yml" ]] {
-           cat "Test/${scriptfile:t:r}/info.yml"
-       }
+            cat "Test/${scriptfile:t:r}/info.yml"
+        }
     }
 } \
 else {
index 130374e5315ba334e1d0a12aa1a2a426a8ed31b8..37a49c6585b73e543cead0ba24d975ec1cb89e12 100755 (executable)
@@ -60,17 +60,17 @@ for scriptfile ($filelist) {
     perl -ne '$score += $1 -1 if /Severity: (\d+)/; END { printf "%3d", $score }' "Test/${scriptfile:t:r}/perlcritic.log" 2>/dev/null
     print -n '   '$T
     if [[ $pass -lt 3 ]]  {
-       if [[ -n $allow_fail[$scriptfile:t:r] ]] || [[ ! -f scripts/${scriptfile:t:r}.pl ]] {
-           print -n '  '$skipmark'   '
-       } \
-       else {
-           print -n '  '$failmark'   '
-           if [[ $failed -lt 254 ]] { ((++failed)) }
-       }
+        if [[ -n $allow_fail[$scriptfile:t:r] ]] || [[ ! -f scripts/${scriptfile:t:r}.pl ]] {
+            print -n '  '$skipmark'   '
+        } \
+        else {
+            print -n '  '$failmark'   '
+            if [[ $failed -lt 254 ]] { ((++failed)) }
+        }
     } \
     else {
-       print -n '  '$passmark'   '; ((++pass))
-       echo 1>"Test/${scriptfile:t:r}/passed"
+        print -n '  '$passmark'   '; ((++pass))
+        echo 1>"Test/${scriptfile:t:r}/passed"
     }
     if [[ $+cached_run[(r)$scriptfile] -gt 0 ]] {
         print -n $T' (c)'
index 6191d12c5e56eeb569a2ca3aa660f3eae705ffbc..6b8d40b1edfa97ca7646c2595ba979354875937c 100755 (executable)
@@ -2,14 +2,19 @@
 local base_path="`pwd`"
 local test_script="$base_path/_testing/_irssi_test.pl"
 
+if [[ $(perl -MEncode -e'print $Encode::VERSION') == 2.88 ]] {
+   echo "Broken Encode version (2.88). Please update the Perl Encode module."
+   exit 4
+}
+
 . ./_testing/_get_files_arr.zsh
 
 for scriptfile ($filelist) {
     rm -rf "Test/${scriptfile:t:r}"
     mkdir -p "Test/${scriptfile:t:r}"
     if [[ ! -f scripts/${scriptfile:t:r}.pl ]] {
-       {echo "command not found: script ${scriptfile:t:r}";echo "test skipped"} >"Test/${scriptfile:t:r}/perlcritic.log"
-       continue
+        {echo "command not found: script ${scriptfile:t:r}";echo "test skipped"} >"Test/${scriptfile:t:r}/perlcritic.log"
+        continue
     }
     perlcritic --theme certrule --exclude RequireEndWithOne -2 scripts/${scriptfile:t:r}.pl >"Test/${scriptfile:t:r}/perlcritic.log" 2>&1
     pushd Test
@@ -38,6 +43,9 @@ STARTUP
     if [[ ! -s stderr.log ]] { rm -f stderr.log }
     popd
     printf . >&2
+    if [[ -n $GITHUB_ACTION ]] {
+        echo /$scriptfile >&2
+    }
     popd
     logs=(~/irc.log.*(N))
     if [[ $#logs -gt 0 ]] {
index f798818f71ee528e4c1851f6218ff99d5e401d23..98086d7783bfb9978f154f4031b2bf8b5758116b 100644 (file)
@@ -5,7 +5,7 @@ if [[ $TRAVIS_PULL_REQUEST != false ]] {
     scriptfiles=($(git diff --numstat --no-renames $TRAVIS_BRANCH|cut -f3|grep '^scripts/.*\.pl'))
     IFS=$OIFS
     if [[ $#scriptfiles -gt 0 ]] {
-       filelist=($scriptfiles)
+        filelist=($scriptfiles)
     }
 } \
 elif [[ $USE_ARTEFACTS_CACHE = yes ]] {
index 1ce622986eb31b13e06118dd659b692f643903e2..1c5be149bd56d3ffdfc0b3475bf3bc583ebf3d1d 100755 (executable)
@@ -7,21 +7,21 @@ if [[ $TRAVIS_PULL_REQUEST != false ]] {
     for scriptfile ($filelist) {
         echo '--- '$scriptfile:t
         if [[ -f "Test/${scriptfile:t:r}/failed.yml" ]] {
-           echo "FATAL: SCRIPT FAILED TO LOAD  "
-       }
+            echo "FATAL: SCRIPT FAILED TO LOAD  "
+        }
         cat "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null
         cat "Test/${scriptfile:t:r}/irssi.log"
-       echo
-       echo 'Source code critic:'
-       cat "Test/${scriptfile:t:r}/perlcritic.log"
-       echo
+        echo
+        echo 'Source code critic:'
+        cat "Test/${scriptfile:t:r}/perlcritic.log"
+        echo
     }
     echo
     echo '======== YAML DATABASE ========'
     for scriptfile ($filelist) {
         if [[ ! -f "Test/${scriptfile:t:r}/failed.yml" ]] {
-           cat "Test/${scriptfile:t:r}/info.yml"
-       }
+            cat "Test/${scriptfile:t:r}/info.yml"
+        }
     }
 } \
 else {
index 2c155f7e31497e5fc0f162647043dede1c1a1a60..04228e47b34bfafebe7ca3055c550bbf59650254 100644 (file)
@@ -21,44 +21,44 @@ for (@{$docs[0]//[]}) {
 my %newmeta;
 for my $file (<scripts/*.pl>) {
     my ($filename, $base) =
-       $file =~ m,^scripts/((.*)\.pl)$,;
+        $file =~ m,^scripts/((.*)\.pl)$,;
     my $info_file = "Test/$base/info.yml";
     my @cdoc;
     if (-f $info_file && open my $ef, '<:utf8', $info_file) {
-       local $@;
-       @cdoc = eval { Load(do { local $/; <$ef> }); };
-       if ($@) {
-           print "ERROR $base: $@\n";
-           @cdoc=();
-       }
+        local $@;
+        @cdoc = eval { Load(do { local $/; <$ef> }); };
+        if ($@) {
+            print "ERROR $base: $@\n";
+            @cdoc=();
+        }
     }
     if (@cdoc) {
-       $newmeta{$filename} = $cdoc[0][0];
-       for my $copykey (qw(modified version)) {
-           unless (defined $newmeta{$filename}{$copykey}) {
-               $newmeta{$filename}{$copykey}
-                   = $oldmeta{$filename}{$copykey}
-                       if defined $oldmeta{$filename}{$copykey};
-           }
-       }
-       $newmeta{$filename}{filename} = $filename;
-       my $modules = delete $newmeta{$filename}{modules};
-       $newmeta{$filename}{modules}
-           = join ' ', @$modules
-               if 'ARRAY' eq ref $modules;
-       my $commands = delete $newmeta{$filename}{commands};
-       my @commands = grep { !/ / } @$commands
-               if 'ARRAY' eq ref $commands;
-       $newmeta{$filename}{commands} = "@commands"
-           if @commands;
+        $newmeta{$filename} = $cdoc[0][0];
+        for my $copykey (qw(modified version)) {
+            unless (defined $newmeta{$filename}{$copykey}) {
+                $newmeta{$filename}{$copykey}
+                    = $oldmeta{$filename}{$copykey}
+                        if defined $oldmeta{$filename}{$copykey};
+            }
+        }
+        $newmeta{$filename}{filename} = $filename;
+        my $modules = delete $newmeta{$filename}{modules};
+        $newmeta{$filename}{modules}
+            = join ' ', @$modules
+                if 'ARRAY' eq ref $modules;
+        my $commands = delete $newmeta{$filename}{commands};
+        my @commands = grep { !/ / } @$commands
+                if 'ARRAY' eq ref $commands;
+        $newmeta{$filename}{commands} = "@commands"
+            if @commands;
     }
     elsif (exists $oldmeta{$filename}) {
-       print "META-INF FOR $base NOT FOUND\n";
-       system "ls 'Test/$base/'*";
-       $newmeta{$filename} = $oldmeta{$filename};
+        print "META-INF FOR $base NOT FOUND\n";
+        system "ls 'Test/$base/'*";
+        $newmeta{$filename} = $oldmeta{$filename};
     }
     else {
-       print "MISSING META FOR $base\n";
+        print "MISSING META FOR $base\n";
     }
 }
 my @newdoc = map {
@@ -77,15 +77,15 @@ if ($config && @{$config->{whitelist}//[]}) {
     my $changed;
     my @wl;
     for my $sf (@{$config->{whitelist}}) {
-       if (-s "Test/$sf:passed") {
-           $changed = 1;
-       }
-       else {
-           push @wl, $sf;
-       }
+        if (-s "Test/$sf:passed") {
+            $changed = 1;
+        }
+        else {
+            push @wl, $sf;
+        }
     }
     if ($changed) {
-       $config->{whitelist} = \@wl;
-       YAML::Tiny::DumpFile('_testing/config.yml', $config);
+        $config->{whitelist} = \@wl;
+        YAML::Tiny::DumpFile('_testing/config.yml', $config);
     }
 }
index 272ba6f6af73d9c8cd3231f2971d7e83b1869ee2..60aec3db1fd13d0f451f1d6f0b4a6db9ba10bb7c 100755 (executable)
@@ -68,12 +68,12 @@ for my $sc (sort { $a->{modified} cmp $b->{modified} } @$x) {
     my %sc = %$sc;
     #sleep 1;
     my $res = p("https://$cred{user}:$cred{pass}\@api.github.com/repos/$cred{user}/scripts.irssi.org/issues/$issue/comments"
-               => {Accept => "*/*"}
-               => json
-               => {
-                   body => "$sc{filename}\n---\n$sc{description}\n\nClick on ![+😃](https://user-images.githubusercontent.com/5665186/52212818-af6a7480-288d-11e9-9e48-4822b0a8efce.png) :+1: :-1: to add your votes"
-               }
-              );
+                => {Accept => "*/*"}
+                => json
+                => {
+                    body => "$sc{filename}\n---\n$sc{description}\n\nClick on ![+😃](https://user-images.githubusercontent.com/5665186/52212818-af6a7480-288d-11e9-9e48-4822b0a8efce.png) :+1: :-1: to add your votes"
+                }
+               );
     say $res->code;
     unless ($res->code == 201) { say $res->body; exit 1; }
     exit;
git clone https://git.99rst.org/PROJECT