Skip to content

Commit

Permalink
[prune-gh-workflow-runs] dryrun logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustielin committed Apr 12, 2024
1 parent 683c22b commit 668afa7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
15 changes: 6 additions & 9 deletions prune-github-workflow-runs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ Delete obsolete runs of workflows that do not exist anymore in the given repo.

## Inputs

| parameter | description | required | default |
| --- | --- | --- | --- |
| token | GitHub access token | `true` | |
| owner | Repository owner | `false` | ${{ github.repository_owner }} |
| repo | Repository name | `false` | ${{ github.event.repository.name }} |
| dry-run | Do not delete runs, just print them | `false` | false |

| parameter | description | required | default |
| --------- | ----------------------------------- | -------- | ----------------------------------- |
| token | GitHub access token | `true` | |
| owner | Repository owner | `false` | ${{ github.repository_owner }} |
| repo | Repository name | `false` | ${{ github.event.repository.name }} |
| dry-run | Do not delete runs, just print them | `false` | false |

## Runs

This action is a `node20` action.


3 changes: 2 additions & 1 deletion prune-github-workflow-runs/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31724,7 +31724,8 @@ Deleting their workflow runs now...`);
workflow_id: wf.id,
}, (response) => response.data);
for (const [index, run] of workflowRuns.entries()) {
core.info(`Workflow: "${wf.name}" - Deleting Run (${index + 1}/${workflowRuns.length}) - Run ID: ${run.id}`);
const workflowInfo = `${dryRun ? "[DRY-RUN] " : ""}Workflow: "${wf.name}" - Deleting Run (${index + 1}/${workflowRuns.length}) - Run ID: ${run.id}`;
core.info(workflowInfo);
try {
if (!dryRun) {
await ghClient.rest.actions.deleteWorkflowRun({
Expand Down
2 changes: 1 addition & 1 deletion prune-github-workflow-runs/dist/index.js.map

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions prune-github-workflow-runs/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ Deleting their workflow runs now...`,
);

for (const [index, run] of workflowRuns.entries()) {
core.info(
`Workflow: "${wf.name}" - Deleting Run (${index + 1}/${
workflowRuns.length
}) - Run ID: ${run.id}`,
);
const workflowInfo = `${dryRun ? "[DRY-RUN] " : ""}Workflow: "${wf.name}" - Deleting Run (${index + 1}/${
workflowRuns.length
}) - Run ID: ${run.id}`;
core.info(workflowInfo);
try {
if (!dryRun) {
await ghClient.rest.actions.deleteWorkflowRun({
Expand Down

0 comments on commit 668afa7

Please sign in to comment.