cloudposse / cloudposse/github-commenter
Feature Request: Expose Flags/Vars to Templating
- 主要语言
- Go
- 星标
- 112
- 派生
- 17
- PR 合并指标
- 30 天内没有已合并 PR
描述
It would be quite neat if we could call the other global vars defined in the main.go when writing our Go templates.
Perhaps in turn call our comment data type explicitly. (i.e. `{{.comment}}`
`token,owner,repo,commentType,sha,number,file,position,templ,format,comment,deleteCommentRegex,baseURL,uploadURL`
Example Template:
```
## Things Deployed to Platform in #{{.number}}
This is a test of the emergency broadcast system, this is only a test.
#A Header about the things we are deploying
{{.comment}} - `A body that is generated in via bash`
```
If I am reading `func formatComment(comment string) (string, error)` correct, presently it passes `comment` to the formatter explicitly.
贡献指南
调研方向
从 main.go 开始,跟踪 func formatComment(comment string) (string, error),了解当前如何向 Go template 提供评论数据。检查列出的 globals 是如何定义并传入格式化过程的。当模板可以访问所请求的 vars(包括评论数据),且示例模板按预期渲染时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- github, go
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100