-
Notifications
You must be signed in to change notification settings - Fork 295
fix: suppress spurious error annotations in push_repo_memory for expected git failures #19979
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
Changes from all commits
5c4a8c1
8e13428
877e837
92641df
75c078e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,7 +127,7 @@ async function main() { | |
| // This is necessary because checkout was configured with sparse-checkout | ||
| core.info(`Disabling sparse checkout...`); | ||
| try { | ||
| execGitSync(["sparse-checkout", "disable"], { stdio: "pipe" }); | ||
| execGitSync(["sparse-checkout", "disable"], { stdio: "pipe", suppressLogs: true }); | ||
| } catch (error) { | ||
| // Ignore if sparse checkout wasn't enabled | ||
| core.info("Sparse checkout was not enabled or already disabled"); | ||
|
|
@@ -140,7 +140,7 @@ async function main() { | |
|
|
||
| // Try to fetch the branch | ||
| try { | ||
| execGitSync(["fetch", repoUrl, `${branchName}:${branchName}`], { stdio: "pipe" }); | ||
| execGitSync(["fetch", repoUrl, `${branchName}:${branchName}`], { stdio: "pipe", suppressLogs: true }); | ||
| execGitSync(["checkout", branchName], { stdio: "inherit" }); | ||
| core.info(`Checked out existing branch: ${branchName}`); | ||
| } catch (fetchError) { | ||
|
|
@@ -377,10 +377,10 @@ async function main() { | |
| // Pull with merge strategy (ours wins on conflicts) | ||
| core.info(`Pulling latest changes from ${branchName}...`); | ||
| try { | ||
| execGitSync(["pull", "--no-rebase", "-X", "ours", repoUrl, branchName], { stdio: "inherit" }); | ||
| execGitSync(["pull", "--no-rebase", "-X", "ours", repoUrl, branchName], { stdio: "inherit", suppressLogs: true }); | ||
| } catch (error) { | ||
| // Pull might fail if branch doesn't exist yet or on conflicts - this is acceptable | ||
| core.warning(`Pull failed (this may be expected): ${getErrorMessage(error)}`); | ||
| core.info(`Pull failed (this is expected when branch does not exist yet): ${getErrorMessage(error)}`); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Downgrading from |
||
| } | ||
|
|
||
| // Push changes | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice pattern — destructuring
suppressLogsbefore spreading...spawnOptionsensures the custom flag never leaks intospawnSyncoptions. Clean and safe.