Skip to content

Commit

Permalink
chore: setFailed instead of throwing (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Mar 21, 2022
1 parent 73704d9 commit 2ed7f35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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

0 comments on commit 2ed7f35

Please sign in to comment.