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

fix: don't output full .Packages-* #164

Merged
merged 3 commits into from
Jun 13, 2024
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
8 changes: 4 additions & 4 deletions dist/build-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127551,11 +127551,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
_actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -127567,11 +127567,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr);
}
Expand Down
8 changes: 4 additions & 4 deletions dist/build-crates-standalone-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127536,11 +127536,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
_actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -127552,11 +127552,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr);
}
Expand Down
8 changes: 4 additions & 4 deletions dist/bump-crates-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -81257,11 +81257,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
_actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -81273,11 +81273,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr);
}
Expand Down
8 changes: 4 additions & 4 deletions dist/create-release-branch-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24749,11 +24749,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
lib_core.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,external_child_process_namespaceObject.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -24765,11 +24765,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
lib_core.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
lib_core.info(`\u001b[1mstderr:\u001b[0m`);
lib_core.info(returns.stderr);
}
Expand Down
8 changes: 4 additions & 4 deletions dist/publish-crates-cargo-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -81145,11 +81145,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
_actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -81161,11 +81161,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr);
}
Expand Down
10 changes: 5 additions & 5 deletions dist/publish-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127531,11 +127531,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
_actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -127547,11 +127547,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr);
}
Expand Down Expand Up @@ -127735,9 +127735,9 @@ async function main(input) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)("sudo apt-get update");
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)("sudo apt-get install -y dpkg-dev");
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(packagesPath, (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`dpkg-scanpackages --multiversion ${input.version}`));
const packages = (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)("cat .Packages-*");
// NOTE: An unzipped package index is necessary for apt-get to recognize the
// local repository created below
const packages = (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cat .Packages-*`, { quiet: true });
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(allPackagesPath, packages);
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(allPackagesGzippedPath, await gzip(packages));
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)("ls -R");
Expand Down
8 changes: 4 additions & 4 deletions dist/publish-crates-eclipse-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127633,11 +127633,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
_actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -127649,11 +127649,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr);
}
Expand Down
8 changes: 4 additions & 4 deletions dist/publish-crates-github-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127612,11 +127612,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
_actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -127628,11 +127628,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr);
}
Expand Down
8 changes: 4 additions & 4 deletions dist/publish-crates-homebrew-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127537,11 +127537,11 @@ function sh(cmd, options) {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;
_actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);
const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -127553,11 +127553,11 @@ function sh(cmd, options) {
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout);
}
if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr);
}
Expand Down
9 changes: 5 additions & 4 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type CommandOptions = {
cwd?: string;
check?: boolean;
input?: string;
quiet?: boolean;
};

export function sh(cmd: string, options?: CommandOptions): string {
Expand All @@ -16,13 +17,13 @@ export function sh(cmd: string, options?: CommandOptions): string {
options.cwd = options.cwd != null ? options.cwd : ".";
options.check = options.check != null ? options.check : true;
options.input = options.input != null ? options.input : "";
options.quiet = options.quiet != null ? options.quiet : false;

core.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`);

const returns = spawnSync(cmd, {
// NOTE: Environment variables defined in `options.env` take precedence over
// the parent process's environment, thus the destructuring is order is
// important
// the parent process's environment, thus the destructuring order is important
env: {
...process.env,
...options.env,
Expand All @@ -35,12 +36,12 @@ export function sh(cmd: string, options?: CommandOptions): string {
maxBuffer: MAX_BUFFER,
});

if (returns.stdout != "") {
if (returns.stdout != "" && !options.quiet) {
core.info(`\u001b[1mstdout:\u001b[0m`);
core.info(returns.stdout);
}

if (returns.stderr != "") {
if (returns.stderr != "" && !options.quiet) {
core.info(`\u001b[1mstderr:\u001b[0m`);
core.info(returns.stderr);
}
Expand Down
2 changes: 1 addition & 1 deletion src/publish-crates-debian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export async function main(input: Input) {
sh("sudo apt-get install -y dpkg-dev");

await fs.writeFile(packagesPath, sh(`dpkg-scanpackages --multiversion ${input.version}`));
const packages = sh("cat .Packages-*");
// NOTE: An unzipped package index is necessary for apt-get to recognize the
// local repository created below
const packages = sh(`cat .Packages-*`, { quiet: true });
await fs.writeFile(allPackagesPath, packages);
await fs.writeFile(allPackagesGzippedPath, await gzip(packages));

Expand Down