Skip to content

Commit

Permalink
Regen
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Feb 19, 2024
1 parent 7993814 commit 997ee27
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020-2021 Buf Technologies, Inc.
Copyright 2020-2024 Buf Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --no-print-directory
BIN := .tmp/bin
COPYRIGHT_YEARS := 2020-2022
COPYRIGHT_YEARS := 2020-2024
LICENSE_IGNORE := -e dist\/

UNAME_OS := $(shell uname -s)
Expand Down
102 changes: 76 additions & 26 deletions dist/main.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/main.js.map

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/buf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -26,7 +26,7 @@ const versionPrefix = "v";

export async function getBuf(
version: string,
githubToken: string
githubToken: string,
): Promise<string | Error> {
const binaryPath = tc.find("buf", version, os.arch());
if (binaryPath !== "") {
Expand All @@ -45,7 +45,7 @@ export async function getBuf(
if (downloadURL.endsWith(".tar.gz")) {
const downloadPath = await tc.downloadTool(downloadURL);
core.info(
`Successfully downloaded buf version "${version}" from ${downloadURL}`
`Successfully downloaded buf version "${version}" from ${downloadURL}`,
);

core.info("Extracting buf...");
Expand All @@ -57,25 +57,25 @@ export async function getBuf(
path.join(extractPath, "buf"),
"buf",
version,
os.arch()
os.arch(),
);
} else {
// For Windows, we only download the .exe for `buf` CLI becasue we do not create `.tar.gz`
// bundles for Windows releases.
const downloadPath = await tc.downloadTool(
downloadURL,
"C:\\Users\\runneradmin\\buf-download\\buf.exe"
"C:\\Users\\runneradmin\\buf-download\\buf.exe",
);
core.info(
`Successfully downloaded buf version "${version}" from ${downloadURL} to ${downloadPath}`
`Successfully downloaded buf version "${version}" from ${downloadURL} to ${downloadPath}`,
);

core.info("Adding buf to the cache...");
cacheDir = await tc.cacheDir(
path.dirname(downloadPath),
"buf",
version,
os.arch()
os.arch(),
);
}
core.info(`Successfully cached buf to ${cacheDir}`);
Expand All @@ -86,7 +86,7 @@ export async function getBuf(
// current architecture and platform.
async function getDownloadURL(
version: string,
githubToken: string
githubToken: string,
): Promise<string | Error> {
let architecture = "";
switch (os.arch()) {
Expand Down Expand Up @@ -152,7 +152,7 @@ async function getDownloadURL(
owner: "bufbuild",
repo: "buf",
per_page: 1,
}
},
);
for (const asset of releases[0].assets) {
if (assetName === asset.name) {
Expand All @@ -170,7 +170,7 @@ async function getDownloadURL(
owner: "bufbuild",
repo: "buf",
tag: tag,
}
},
);
for (const asset of release.assets) {
if (assetName === asset.name) {
Expand Down
2 changes: 1 addition & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
14 changes: 7 additions & 7 deletions src/run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 Buf Technologies, Inc.
// Copyright 2020-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -52,7 +52,7 @@ async function runSetup(): Promise<null | Error> {
const githubToken = core.getInput("github_token");
if (githubToken === "") {
core.warning(
"No github_token supplied, API requests will be subject to stricter rate limiting"
"No github_token supplied, API requests will be subject to stricter rate limiting",
);
}

Expand Down Expand Up @@ -88,29 +88,29 @@ async function runSetup(): Promise<null | Error> {
cp
.execSync(
`${binaryPath} registry login ${bufDomain} --username ${bufUser} --token-stdin`,
{ input: bufAPIToken }
{ input: bufAPIToken },
)
.toString()
.toString(),
);
return null;
}

if (bufUser !== "") {
core.info(
`buf_user is supplied, must also supply buf_token to log into Buf Schema Registry`
`buf_user is supplied, must also supply buf_token to log into Buf Schema Registry`,
);
return null;
}

if (bufAPIToken !== "") {
core.info(
`buf_token is supplied, must also supply buf_user to log into Buf Schema Registry`
`buf_token is supplied, must also supply buf_user to log into Buf Schema Registry`,
);
return null;
}

core.info(
`buf_user and buf_token are not supplied, not logging into Buf Schema Registry`
`buf_user and buf_token are not supplied, not logging into Buf Schema Registry`,
);
return null;
}

0 comments on commit 997ee27

Please sign in to comment.