From dd190a1d93871417b58f07f96fa1fe3e474a35ce Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 30 Jun 2022 09:39:08 -0400 Subject: [PATCH] Get GitHub action script directory referencei2 --- .github/workflows/xcat_test.yml | 3 +-- github_action_xcat_test.pl | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcat_test.yml b/.github/workflows/xcat_test.yml index 35411e1f1..c807cc459 100644 --- a/.github/workflows/xcat_test.yml +++ b/.github/workflows/xcat_test.yml @@ -1,7 +1,6 @@ name: xcat_test on: - pull_request: - types: [review_requested] + push jobs: xcat_pr_test: runs-on: ubuntu-latest diff --git a/github_action_xcat_test.pl b/github_action_xcat_test.pl index c0526a07b..5aa62aa51 100644 --- a/github_action_xcat_test.pl +++ b/github_action_xcat_test.pl @@ -15,6 +15,7 @@ use Encode::CN; use JSON; use URI::Escape; use LWP::Simple; +use Cwd; use Term::ANSIColor qw(:constants); $Term::ANSIColor::AUTORESET = 1; @@ -333,6 +334,14 @@ sub install_xcat{ "sudo wget -q -O - \"http://xcat.org/files/xcat/repos/apt/apt.key\" | sudo apt-key add -", "sudo apt-get -qq --allow-insecure-repositories update"); my @output; + my $dir = cwd; + print "[MG] Current working dir $dir"; + @output = runcmd("cd $dir"); + if($::RUNCMD_RC){ + print RED "[MG] cd to $dir ...[Failed]\n"; + print "[MG] error message:\n"; + print Dumper \@output; + } foreach my $cmd (@cmds){ print "[install_xcat] running $cmd\n"; @output = runcmd("$cmd");