Skip to content

Latest commit

 

History

History
63 lines (52 loc) · 1.3 KB

README.md

File metadata and controls

63 lines (52 loc) · 1.3 KB

GHA Summarizer GHA Summarizer

Simple action for Go template based summarization of GitHub Actions workflow runs. It supports usual Go templating features, check text/template for more details.

Usage

- 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

Functions

Additionally some helper functions are provided:

filep

Check if file exists.

{{ if filep "./example/code.go" -}}
```go
{{ file "./example/code.go"}}
```
{{- end }}

file

Embedd file content in the template.

# Sample template
```go
{{ file "./example/code.go"}}
```

envp

Checks if environment variable is set.

{{ if envp "GITHUB_REPOSITORY" -}}
{{ env "$GITHUB_REPOSITORY }}
{{- end }}

env

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" }}`
```