Skip to content
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
5 changes: 3 additions & 2 deletions actions/setup/js/extra_empty_commit.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/// <reference types="@actions/github-script" />

const { validateTargetRepo, parseAllowedRepos, getDefaultTargetRepo } = require("./repo_helpers.cjs");
const { getErrorMessage } = require("./error_helpers.cjs");

/**
* @fileoverview Extra Empty Commit Helper
Expand Down Expand Up @@ -150,7 +151,7 @@ async function pushExtraEmptyCommit({ branchName, repoOwner, repoName, commitMes
} catch (error) {
// Non-fatal: if fetch/reset fails (e.g. branch not yet on remote), continue
// with the local HEAD and attempt the push anyway.
const syncErrorMessage = error instanceof Error ? error.message : String(error);
const syncErrorMessage = getErrorMessage(error);
core.warning(`Could not sync local branch with remote ${branchName} - will attempt push with local HEAD. Underlying error: ${syncErrorMessage}`);
}

Expand All @@ -170,7 +171,7 @@ async function pushExtraEmptyCommit({ branchName, repoOwner, repoName, commitMes

return { success: true };
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
const errorMessage = getErrorMessage(error);
core.warning(`Failed to push extra empty commit: ${errorMessage}`);

// Clean up the temporary remote on failure
Expand Down
Loading