Skip to content

Commit

Permalink
Update Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
guptamukul-google committed Nov 15, 2021
1 parent ec4320b commit 279a6af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions tools/tf-plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 279a6af

Please sign in to comment.