Skip to content

Commit 42a24e6

Browse files
committed
fix: enhance error message for non-existent branch during deployment
1 parent 4208d2c commit 42a24e6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/functions/prechecks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ export async function prechecks(context, octokit, data) {
401401
core.debug(`✅ branch exists: ${ref}`)
402402
} catch (error) {
403403
if (error.status === 404) {
404-
message = `### ⚠️ Cannot proceed with deployment\n\n- ref: \`${ref}\`\n\n> The branch for this pull request no longer exists. This can happen if the branch was deleted after the PR was merged or closed. If you need to deploy, you can:\n> - Use the stable branch deployment (e.g., \`${data.inputs.trigger} ${data.inputs.stable_branch}\`)\n> - Use an exact SHA deployment if enabled (e.g., \`${data.inputs.trigger} ${sha}\`)`
404+
message = `### ⚠️ Cannot proceed with deployment\n\n- ref: \`${ref}\`\n\nThe branch for this pull request no longer exists. This can happen if the branch was deleted after the PR was merged or closed. If you need to deploy, you can:\n- Use the stable branch deployment (e.g., \`${data.inputs.trigger} ${data.inputs.stable_branch}\`)\n- Use an exact SHA deployment if enabled (e.g., \`${data.inputs.trigger} ${sha}\`)\n\n> If you are running this command on a closed pull request, you can also try reopening the pull request to restore the branch for a deployment.`
405405
core.warning(`branch does not exist: ${ref}`)
406406
return {message: message, status: false}
407407
}

0 commit comments

Comments
 (0)