mercari / tfnotify

A CLI command to parse Terraform execution result and notify it to GitHub
MIT License
619 stars 91 forks source link

Support Terraform `0.15` or later #104

Closed KeisukeYamashita closed 2 years ago

KeisukeYamashita commented 2 years ago

WHAT

As title, tfnotify only supports Terraform version under 0.14.x. Thus, I want to support the later >= 0.15.x Terraform releases.

WHY

Because Terraform changed the output format of the failure messages on plan or apply, the tfnotify runs into cannot parse plan result.

These are the sample failure messages emitted by Terraform for each versions

After 0.15

╷
│ Error: expected rotation_days to be at least (1), got -1
│ 
│   with time_rotating.example,
│   on null_resource.tf line 14, in resource "time_rotating" "example":
│   14:   rotation_days = -1
│ 

Before 0.15

Error: expected rotation_days to be at least (1), got -1

  on null_resource.tf line 14, in resource "time_rotating" "example":
  14:   rotation_days = -1

Because there are | in the beginning, tfnotify can't parse it.

KeisukeYamashita commented 2 years ago

Big fix for the regex match 👉 https://github.com/mercari/tfnotify/pull/107

KeisukeYamashita commented 2 years ago

Also, this was related https://github.com/mercari/tfnotify/issues/108