Skip to content

Commit

Permalink
log incoming settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jstaresincic committed Sep 6, 2022
1 parent 21feeea commit 434c0b4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
26 changes: 15 additions & 11 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

32 changes: 18 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
const { getInput, setFailed, info } = require('@actions/core');
const { context } = require('@actions/github');
const deleteVersions = require('./delete-versions');
const { getInput, setFailed, info } = require("@actions/core");
const { context } = require("@actions/github");
const deleteVersions = require("./delete-versions");

async function run() {
try {
const inputs = {
owner: getInput('owner') || context.repo.owner,
repo: getInput('repo') || context.repo.repo,
keepCnt: getInput('keepCnt'),
dryRun: getInput('dryRun'),
token: getInput('token'),
}
owner: getInput("owner") || context.repo.owner,
repo: getInput("repo") || context.repo.repo,
keepCnt: getInput("keepCnt"),
dryRun: getInput("dryRun"),
token: getInput("token"),
};
info("Input values:");
Object.values(inputs).map((v) => info(v));
const deleted = await deleteVersions(inputs);
if (inputs.dryRun) {
info('Dry run is NOT deleting packages, list below is what would be deleted')
}
deleted.forEach(package => {
package.versions.forEach(v => {
if (inputs.dryRun) {
info(
"Dry run is NOT deleting packages, list below is what would be deleted"
);
}
deleted.forEach((package) => {
package.versions.forEach((v) => {
info(`Deleted ${package.name} version ${v.version}`);
});
});
Expand Down

0 comments on commit 434c0b4

Please sign in to comment.