Skip to content

Commit 79207c8

Browse files
committed
Apply suggestions
1 parent dd7cdd2 commit 79207c8

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/action/disco.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (c *Disco) Run(cc *cli.Context) (err error) {
7777
fileEnforcementLevel[path] = EnforcementOptional
7878
continue
7979
}
80-
if strings.Contains(string(b), ":alchemy-discoballed:") {
80+
if strings.Contains(string(b), "\n:alchemy-discoballed:") || strings.HasPrefix(string(b), ":alchemy-discoballed:") {
8181
fileEnforcementLevel[path] = EnforcementMandatory
8282
} else {
8383
fileEnforcementLevel[path] = EnforcementOptional
@@ -152,7 +152,7 @@ func (c *Disco) Run(cc *cli.Context) (err error) {
152152

153153
if hasMandatory {
154154
slog.Info("Setting mandatory patch outputs")
155-
err = os.WriteFile("disco-mandatory.patch", outMandatory.Bytes(), os.ModeAppend|0644)
155+
err = os.WriteFile("disco-mandatory.patch", outMandatory.Bytes(), 0644)
156156
if err != nil {
157157
return fmt.Errorf("failed saving mandatory patch: %v", err)
158158
}
@@ -162,7 +162,7 @@ func (c *Disco) Run(cc *cli.Context) (err error) {
162162

163163
if hasOptional {
164164
slog.Info("Setting optional patch outputs")
165-
err = os.WriteFile("disco-optional.patch", outOptional.Bytes(), os.ModeAppend|0644)
165+
err = os.WriteFile("disco-optional.patch", outOptional.Bytes(), 0644)
166166
if err != nil {
167167
return fmt.Errorf("failed saving optional patch: %v", err)
168168
}

cmd/action/github/pr.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ func GetPRChangedFilesWithStatus(cxt context.Context, githubContext *githubactio
8585
return
8686
}
8787
for _, file := range files {
88-
if *file.Status == "deleted" {
88+
if file.GetStatus() == "deleted" {
8989
continue
9090
}
91-
slog.Info("changed file", "file", *file.Filename, "status", *file.Status)
92-
changedFiles[*file.Filename] = FileStatus(*file.Status)
91+
slog.Info("changed file", "file", file.GetFilename(), "status", file.GetStatus())
92+
changedFiles[file.GetFilename()] = FileStatus(file.GetStatus())
9393
}
9494
if resp.NextPage == 0 {
9595
break

0 commit comments

Comments
 (0)