Comments (3)
@dtan4 Thank you for your report.
One solution is using triple backquotes. I prefer this solution.
Yes, I know.
Now, I'm using backquotes for string literals.
tfnotify/terraform/template.go
Lines 45 to 59 in ecebe34
It's true that I'd like to use backquotes in string literals but I don't know how to use it in string literals like this:
DefaultPlanTemplate = `
{{ .Title }}
{{ .Message }}
{{if .Result}}
```
{{ .Result }}
```
{{end}}
<details><summary>Details (Click me)</summary>
```
{{ .Body }}
```
</details>
`
How can I use triple backquotes in backquotes (string literals)?
from tfnotify.
Yes, triple backquotes cannot be written in raw string literal.
We can concatenate both interpreted string literals and raw string literals.
So how about this:
DefaultPlanTemplate = `
{{ .Title }}
{{ .Message }}
{{if .Result}}
` + "```" + `
{{ .Result }}
` + "```" + `
{{end}}
<details><summary>Details (Click me)</summary>
` + "```" + `
{{ .Body }}
` + "```" + `
</details>
`
from tfnotify.
Hi. I also suffer from the same problem with the template examples in README.md . This issue would be solved if an empty line is added after the </summary>
tag. Show an example below.
Add no empty lines
Details (Click me)
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
aws_instance.example: Refreshing state...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
aws_instance.example will be created
+ resource "aws_instance" "example" {
+ instance_type = "t3.micro"
}
Plan: 1 to add, 0 to change, 0 to destroy.
Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.
Add an empty line
Details (Click me)
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
aws_instance.example: Refreshing state...
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_instance.example will be created
+ resource "aws_instance" "example" {
+ instance_type = "t3.micro"
}
Plan: 1 to add, 0 to change, 0 to destroy.
------------------------------------------------------------------------
Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.
Pull request #45 is to fix this problem in the all template examples and the default templates within this repository. Please look at it.
from tfnotify.
Related Issues (20)
- Broken private pool Cloud Build build result links HOT 1
- Support Terraform `0.15` or later HOT 2
- Error while parsing the output only changes for Terraform `>=0.15` HOT 1
- `tfnotify` support custom environment variable
- Gitlab comments don't work
- No Github comments from tfnotify HOT 7
- Is this project abandoned? I am happy to take over HOT 3
- Support Drone HOT 1
- terraform 0.12 planfile support HOT 2
- can we use markdown in template?
- fail go get current master HEAD ( b8bbe9b ) HOT 2
- Does not delete first comment on commit revision in github. HOT 1
- Any chance of some ARM releases HOT 1
- Tfnotify does not trace organization ownership transfer HOT 1
- tfnotify --version not working
- New comment every time or updates to existing comments? HOT 1
- Support to configure a label color HOT 2
- Parsing fails when only any output values are added
- Github apply notification not goes to the current commit HOT 1
- tfnotify migth be not working on github actions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tfnotify.