Skip to content

Support changing template #793

@suzuki-shunsuke

Description

@suzuki-shunsuke

When -k isn't specified, the template default is used at the moment.
You can't change the template dynamically.

In this proposal, we support changing the template dynamically according to the command line arguments and executed command result.

Drawback of this idea

if condition may be broken unexpectedly.
For example, if: Command startsWith "gh issue create" doesn't match gh -R suzuki-shunsuke/github-comment issue create.

Example

e.g.

exec_if:
- if: Command startsWith "tfmigrate plan"
  template_key: tfmigrate-plan
exec:
  tfmigrate-plan:
  - when: true
    template: |
      ## {{template "status" .}} {{if .Vars.tfaction_target}}{{.Vars.tfaction_target}}: {{end}} tfmigrate plan
      {{template "link" .}}
      {{template "join_command" .}}
      {{template "hidden_combined_output" .}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions