Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declining the security prompt should cancel state commit. #3587

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions internal/runners/commit/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,6 @@ func (c *Commit) Run() (rerr error) {
return errs.Wrap(err, "Could not update project to reflect build script changes.")
}

// Update local commit ID
if err := localcommit.Set(proj.Dir(), stagedCommit.CommitID.String()); err != nil {
return errs.Wrap(err, "Could not set local commit ID")
}

// Update our local build expression to match the committed one. This allows our API a way to ensure forward compatibility.
newScript, err := bp.GetBuildScript(stagedCommit.CommitID.String())
if err != nil {
return errs.Wrap(err, "Unable to get the remote build script")
}
if err := buildscript_runbit.Update(proj, newScript); err != nil {
return errs.Wrap(err, "Could not update local build script")
}

pg.Stop(locale.T("progress_success"))
pg = nil

Expand Down Expand Up @@ -169,6 +155,20 @@ func (c *Commit) Run() (rerr error) {
return errs.Wrap(err, "Could not report CVEs")
}

// Update local commit ID
if err := localcommit.Set(proj.Dir(), stagedCommit.CommitID.String()); err != nil {
return errs.Wrap(err, "Could not set local commit ID")
}

// Update our local build expression to match the committed one. This allows our API a way to ensure forward compatibility.
newScript, err := bp.GetBuildScript(stagedCommit.CommitID.String())
if err != nil {
return errs.Wrap(err, "Unable to get the remote build script")
}
if err := buildscript_runbit.Update(proj, newScript); err != nil {
return errs.Wrap(err, "Could not update local build script")
}

out.Notice("") // blank line
out.Print(output.Prepare(
locale.Tl(
Expand Down
Loading