Skip to content

VOID404/gha-summarizer

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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