From 279a6af5868ead21acfa4d4a4a2eb556e43c521f Mon Sep 17 00:00:00 2001 From: Mukul Gupta Date: Mon, 15 Nov 2021 12:11:38 -0800 Subject: [PATCH] Update Workflows --- .github/workflows/check-license.yml | 2 +- tools/tf-plan.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml index eb3c2090..eef3969e 100644 --- a/.github/workflows/check-license.yml +++ b/.github/workflows/check-license.yml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 'CHECK - Check Lisence Boilerplate' +name: 'CHECK - License Boilerplate' on: schedule: diff --git a/tools/tf-plan.py b/tools/tf-plan.py index 30f3245c..d1eb44dc 100644 --- a/tools/tf-plan.py +++ b/tools/tf-plan.py @@ -99,6 +99,7 @@ def main(PR): commentpr(GITHUB_REPOSITORY, PR, comment, TOKEN) if(status == 'fail'): sys.exit('Terraform Init or Terraform Plan FAILED for: '+ dir) + except requests.exceptions.RequestException as e: print('No working directory with TF configs in PR.') raise SystemExit(e) @@ -171,13 +172,13 @@ def tf(dir): return_code_plan, stdout_plan, stderr_plan = tr.plan_cmd(capture_output=False,var={'billing_account_id':'ABCD-EFGH-IJKL-MNOP', 'organization_id':'1234567890', 'random_id': '1234'}) if(return_code_init == 1): - comment = 'Terraform Init FAILED for: **' + dir.replace(os.getcwd()+'/temp/', '' +'** !') + comment = 'Terraform Init FAILED for: **' + dir.replace(os.getcwd()+'/temp/', '') + '** !' status = 'fail' if(return_code_plan == 1): - comment = 'Terraform Plan FAILED for: **' + dir.replace(os.getcwd()+'/temp/', '' +'** !') + comment = 'Terraform Plan FAILED for: **' + dir.replace(os.getcwd()+'/temp/', '') + '** !' status = 'fail' else: - comment = 'Terraform Init & Terraform Plan SUCCESSFUL for: **' + dir.replace(os.getcwd()+'/temp/', '' +'** !') + comment = 'Terraform Init & Terraform Plan SUCCESSFUL for: **' + dir.replace(os.getcwd()+'/temp/', '') + '** !' return comment, status