Skip to content

Commit

Permalink
Fix magic number warning by extracting constant
Browse files Browse the repository at this point in the history
  • Loading branch information
johnboyes authored Feb 10, 2024
1 parent 36c0771 commit 7d1aec2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/github/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,14 @@ func (a *Action) pullRequestNumber() int {
}

func (a *Action) outputResult(result string) {
const UserReadWriteFilePermission = 0o644

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) //nolint:gosec
githubOutputFile, err := os.OpenFile(gitHubOutputFileName, os.O_APPEND|os.O_WRONLY, UserReadWriteFilePermission) //nolint:gosec,lll
panic.IfError(err)
_, err = githubOutputFile.WriteString(labelCheckOutput)

if err != nil {
closingErr := githubOutputFile.Close()

Expand Down

0 comments on commit 7d1aec2

Please sign in to comment.