Skip to content

Commit

Permalink
test pr
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenlu committed Feb 18, 2024
1 parent 933901b commit 53fd6c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions atlasaction/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ func (g *githubAPI) addSuggestions(act *githubactions.Action, payload *atlasexec
filePath := path.Join(payload.Env.Dir, file.Name)
for _, report := range file.Reports {
for _, s := range report.SuggestedFixes {
if err := g.commentSuggestion(event.PullRequestNumber, ghContext.SHA, filePath, s); err != nil {
if err := g.commentSuggestion(event.PullRequestNumber, ghContext.Ref, filePath, s); err != nil {
return err
}
}
for _, d := range report.Diagnostics {
for _, s := range d.SuggestedFixes {
if err := g.commentSuggestion(event.PullRequestNumber, ghContext.SHA, filePath, s); err != nil {
if err := g.commentSuggestion(event.PullRequestNumber, ghContext.Ref, filePath, s); err != nil {
return err
}
}
Expand Down Expand Up @@ -420,6 +420,7 @@ func (g *githubAPI) commentSuggestion(prID int, commitID, filePath string, sugge
if err != nil {
return err
}
fmt.Println("body sent:", string(buf))
url := fmt.Sprintf("%v/repos/%v/pulls/%v/comments", g.baseURL, g.repo, prID)
req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(buf))
if err != nil {
Expand Down Expand Up @@ -456,7 +457,7 @@ func createRunContext(act *githubactions.Action) (*atlasexec.RunContext, error)
return &atlasexec.RunContext{
Repo: ghContext.Repository,
Branch: branch,
Commit: ghContext.SHA,
Commit: ghContext.Ref,
Path: act.GetInput("dir"),
URL: ev.HeadCommit.URL,
}, nil
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
-- drop table t1;
drop table t1;
4 changes: 2 additions & 2 deletions atlasaction/testdata/migrations_destructive/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
h1:jw+3IjeTY+1ngJYKRc/Ddq8hJkBWpVRnF8qS61zspJg=
h1:H/F2w8bIg7dfvQR4lLFOLhf+bZLwlCAPXMBVJb1VKLc=
20230922132634_init.sql h1:Q+dJaaJDja1u1qEni6E0SfC4dMXhHgW2F1ybAtgcgeE=
20230925192914.sql h1:2YTCgLJQ5t3t71z3zGGRNSaWBItjTXF9zEcQICGIZkc=
20230925192914.sql h1:45yfGQkVGdeGJNj/MEF9xtJdvtW2dWnpvMIhsVjIkiA=

0 comments on commit 53fd6c6

Please sign in to comment.