From 1953ab75bb5e8a527debc3124fa463b847057719 Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Tue, 12 Sep 2023 12:52:03 +0200 Subject: [PATCH] chore: action workflow preamble Add preamble to the generated GitHub workflow yaml. Signed-off-by: Noel Georgi --- .github/workflows/ci.yaml | 4 ++++ internal/output/ghworkflow/gh_workflow.go | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d23afe5f..7bbc6a3f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,7 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2023-09-12T11:35:50Z by kres 3cbfe81-dirty. + name: default "on": push: diff --git a/internal/output/ghworkflow/gh_workflow.go b/internal/output/ghworkflow/gh_workflow.go index 3312ba78..bb3fad96 100644 --- a/internal/output/ghworkflow/gh_workflow.go +++ b/internal/output/ghworkflow/gh_workflow.go @@ -167,6 +167,12 @@ func (o *Output) GenerateFile(filename string, w io.Writer) error { } func (o *Output) config(w io.Writer) error { + preamble := output.Preamble("# ") + + if _, err := w.Write([]byte(preamble)); err != nil { + return fmt.Errorf("failed to write preamble: %w", err) + } + encoder := yaml.NewEncoder(w) defer encoder.Close() //nolint:errcheck