This change enables tfnotify to put comments on GitHub Pull Request, from GitHub Actions triggered by the same Pull Request (on.pull_request).
Screenshot
Example GitHub Actions workflow
# .github/workflows/terraform-plan.yaml
name: "terraform plan for AWS"
on:
pull_request:
jobs:
terraform:
name: "Terraform"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Terraform Init"
run: terraform init
- name: "Terraform Plan"
run: terraform plan | tfnotify --config tfnotify.yaml plan
WHY
Current GitHub Actions support doesn't support workflow triggered by Pull Request because it doesn't read the target Pull Request number. Therefore, we have to use "branch push (on.branches)" as workflow trigger.
Actually, tfnotify with branch-triggered workflow can also put the comment on the Pull Request timeline. However, it lacks some tfnotify features, like putting labels like no-changes based on terraform plan result. Therefore, to provide the equivalent experience to GitHub Actions users as well as other CIs, it's better to implement native Pull Request support.
WHAT
This change enables tfnotify to put comments on GitHub Pull Request, from GitHub Actions triggered by the same Pull Request (
on.pull_request
).Screenshot
Example GitHub Actions workflow
WHY
Current GitHub Actions support doesn't support workflow triggered by Pull Request because it doesn't read the target Pull Request number. Therefore, we have to use "branch push (
on.branches
)" as workflow trigger. Actually, tfnotify with branch-triggered workflow can also put the comment on the Pull Request timeline. However, it lacks some tfnotify features, like putting labels likeno-changes
based onterraform plan
result. Therefore, to provide the equivalent experience to GitHub Actions users as well as other CIs, it's better to implement native Pull Request support.