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

chore: setFailed instead of throwing #541

Merged
merged 1 commit into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion dist/main/index.js

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/setup-gcloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export const GCLOUD_METRICS_LABEL = 'github-actions-setup-gcloud';
export async function run(): Promise<void> {
// Warn if pinned to HEAD
if (isPinnedToHead()) {
// TODO(sethvargo): switch back to warning level after branch is renamed
// from "master" -> "main".
core.error(pinnedToHeadWarning('v0'));
core.warning(pinnedToHeadWarning('v0'));

// TODO(sethvargo): remove after branch is renamed from "master" -> "main".
const envvar =
Expand All @@ -54,7 +52,7 @@ export async function run(): Promise<void> {
process.env.GITHUB_REPOSITORY_OWNER === 'google-github-actions';
const isAccepted = process.env[envvar];
if (isMaster && !(isOurs || isAccepted)) {
throw new Error(
core.setFailed(
`On 2022-04-05, the default branch will be renamed from "master" to ` +
`"main". Your action is currently pinned to "@master". Even though ` +
`GitHub creates redirects for renamed branches, testing found that ` +
Expand All @@ -75,8 +73,9 @@ export async function run(): Promise<void> {
`begin failing with an obtuse and difficult to diagnose error ` +
`message.\n` +
`\n` +
`For more information, please see ${issueURL}.`,
`For more information, please see: ${issueURL}`,
);
return;
}
}

Expand Down