Skip to content

Commit

Permalink
chore: setFailed instead of throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Mar 21, 2022
1 parent 73704d9 commit 7a63b4f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 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 @@ -77,6 +75,7 @@ export async function run(): Promise<void> {
`\n` +
`For more information, please see ${issueURL}.`,
);
return;
}
}

Expand Down

0 comments on commit 7a63b4f

Please sign in to comment.