From bcd1a61be79f0599e20d76a1e91279e637a5f740 Mon Sep 17 00:00:00 2001 From: John Boyes Date: Sat, 10 Feb 2024 11:19:35 +0000 Subject: [PATCH] Exclude file permissions line from gosec linting The [gosec linter][1] warns by default on [file permissions above 0600][2]. We need the permissions to be 0644 for this line (because it has to be written to), so we exclude it from linting. [1]: https://github.com/securego/gosec [2]: https://github.com/securego/gosec/issues/107 --- internal/github/action.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/github/action.go b/internal/github/action.go index 2f94979..cc37523 100644 --- a/internal/github/action.go +++ b/internal/github/action.go @@ -127,7 +127,7 @@ func (a *Action) pullRequestNumber() int { func (a *Action) outputResult(result string) { labelCheckOutput := fmt.Sprintf("label_check=%s", result) gitHubOutputFileName := filepath.Clean(os.Getenv("GITHUB_OUTPUT")) - githubOutputFile, err := os.OpenFile(gitHubOutputFileName, os.O_APPEND|os.O_WRONLY, 0o644) + githubOutputFile, err := os.OpenFile(gitHubOutputFileName, os.O_APPEND|os.O_WRONLY, 0o644) //nolint:gosec panic.IfError(err) _, err = githubOutputFile.WriteString(labelCheckOutput) if err != nil {