Skip to content

Commit 5652af6

Browse files
authored
Merge pull request #316 from karl-run/master
Add NAIS_DEPLOY_SUMMARY to allow squelching of GITHUB_STEP_SUMMARY output
2 parents e79279e + 9aefadc commit 5652af6

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

actions/deploy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The available configuration options for the NAIS deploy GitHub action.
1616
| OWNER | \(auto-detect\) | Owner of the repository making the request. |
1717
| PRINT\_PAYLOAD | `false` | If `true`, print templated resources to standard output. |
1818
| QUIET | `false` | If `true`, suppress all informational messages. |
19+
| NAIS_DEPLOY_SUMMARY | `true` | If `false`, skips outputting the job summary to $GITHUB_STEP_SUMMARY |
1920
| REPOSITORY | \(auto-detect\) | Name of the repository making the request. |
2021
| RESOURCE | \(required\) | Comma-separated list of files containing Kubernetes resources. Must be JSON or YAML format. |
2122
| RETRY | `true` | Automatically retry deploying if deploy service is unavailable. |

pkg/deployclient/deployclient.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ func (d *Deployer) Deploy(ctx context.Context, cfg *Config, deployRequest *pb.De
249249

250250
// If running in GitHub actions, print a markdown summary
251251
summaryFile, err := os.OpenFile(os.Getenv("GITHUB_STEP_SUMMARY"), os.O_APPEND|os.O_WRONLY, 0644)
252+
summaryEnabled := strings.ToLower(os.Getenv("NAIS_DEPLOY_SUMMARY")) != "false"
252253
summary := func(format string, a ...any) {
253-
if summaryFile == nil {
254+
if summaryFile == nil || !summaryEnabled {
254255
return
255256
}
256257
_, _ = fmt.Fprintf(summaryFile, format+"\n", a...)

0 commit comments

Comments
 (0)