Skip to content

No Github comments from tfnotify #120

@leszczynskimikolaj

Description

@leszczynskimikolaj

My issue:
Even though I set GITHUB_REF env var, I still get tfnotify comments attached to my commits instead of having them attached to related PR and what's more I do not get any labels attached to my PR.

My tfnotify.yml

ci: github-actions
notifier:
  github:
    token: <redacted>
    repository:
      owner: <redacted>
      name: <redacted>
terraform:
  plan:
    template: |
      {{ .Title }}
      {{ .Message }}
      {{if .Result}}
      <pre><code>{{ .Result }}
      </pre></code>
      {{end}}
      <details><summary>Details (Click me)</summary>
      <pre><code>{{ .Body }}
      </pre></code></details>
    when_add_or_update_only:
      label: "add-or-update"
    when_no_changes:
      label: "no-changes"
    when_plan_error:
      label: "error"
    when_destroy:
      label: "destroy"
      template: |
        ## :warning: WARNING: Resource Deletion will happen :warning:
        This plan contains **resource deletion**. Please check the plan result very carefully!

The command I run as part of my local tests:

export GITHUB_REF=refs/pull/240/merge
cat plan_result.temp | tfnotify --config tfnotify.yml plan --message "example tfnotify comment message"

I have a feeling tfnotify does not respect the GITHUB_REF env var I set and hence this code does not get executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions