Simple action for Go template based summarization of GitHub Actions workflow runs. It supports usual Go templating features, check text/template for more details.
- name: Render template
uses: VOID404/[email protected]
with:
template: hack/summary_template.md
out-file: summary.md
- name: Set step output
run: cat summary.md >> $GITHUB_STEP_SUMMARY
Additionally some helper functions are provided:
Check if file exists.
{{ if filep "./example/code.go" -}}
```go
{{ file "./example/code.go"}}
```
{{- end }}
Embedd file content in the template.
# Sample template
```go
{{ file "./example/code.go"}}
```
Checks if environment variable is set.
{{ if envp "GITHUB_REPOSITORY" -}}
{{ env "$GITHUB_REPOSITORY }}
{{- end }}
Get environment variable value. This has access to github context, so you can use it to get values from the workflow run.
```md
# Sample template
Generated from `{{ env "$GITHUB_REPOSITORY" }}`
```
GHA Summarizer is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.