cloudposse / cloudposse/github-commenter

Feature Request: Expose Flags/Vars to Templating

オープン
#20 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start in main.go and trace func formatComment(comment string) (string, error) to see how the Go template is currently given comment data. Check how the listed globals are defined and passed into formatting. Done means templates can access the requested vars, including comment data, and the example template renders as intended.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
github, go
領域
cli
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。