Skip to content

Commit 86d29a7

Browse files
committed
Update deprecated @octokit/rest library call methods
1 parent ab48244 commit 86d29a7

File tree

5 files changed

+122
-239
lines changed

5 files changed

+122
-239
lines changed

README.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ A GitHub Action to delete workflow runs in a repository. This Action uses JavaSc
1212

1313
## Inputs (summary)
1414

15-
| Input | Required | Default | Description |
16-
|---|---:|---|---|
17-
| `token` | No | `${{github.token}}` | GitHub token used for authentication. Use `github.token` for the current repository or a PAT with `repo` scope for cross-repo access. Token must have appropriate permissions (see Permissions). |
18-
| `repository` | No | `${{github.repository}}` | The target repository in `owner/repo` format. |
19-
| `retain_days` | No | `30` | Number of days to retain workflow runs before deletion. |
20-
| `keep_minimum_runs` | No | `6` | Minimum number of runs to keep per workflow. |
21-
| `delete_workflow_pattern` | No | (empty) | Target workflows by name or filename. Supports multiple filters separated by `\|`. Example: `build\|deploy` will match workflows with "build" OR "deploy" in name/filename. Omit to target all workflows. |
22-
| `delete_workflow_by_state_pattern` | No | (empty) | Filter workflows by state (comma-separated): `active`, `deleted`, `disabled_fork`, `disabled_inactivity`, `disabled_manually`. Omit to target all states. |
23-
| `delete_run_by_conclusion_pattern` | No | (empty) | Filter runs by conclusion (comma-separated): `action_required`, `cancelled`, `failure`, `skipped`, `success`. Omit to target all conclusions. |
24-
| `dry_run` | No | `false` | If `true`, simulate deletions and only log actions without performing them. |
25-
| `check_branch_existence` | No | `false` | If `true`, skip deletion for runs linked to an existing branch. Note: default branch (e.g., `main`) can be excluded from deletion checks as configured. |
26-
| `check_pullrequest_exist` | No | `false` | If `true`, skip deletion for runs linked to a pull request. |
27-
| `baseUrl` | No | (GitHub API base) | Optional GitHub Enterprise API base URL (e.g. `https://github.mycompany.com/api/v3`). Set when using GitHub Enterprise / GHES. |
15+
| Input | Default | Description |
16+
|---|---|---|
17+
| `token` | `${{github.token}}` | GitHub token used for authentication. Use `github.token` for the current repository or a PAT with `repo` scope for cross-repo access. Token must have appropriate permissions (see Permissions). |
18+
| `repository` | `${{github.repository}}` | The target repository in `owner/repo` format. |
19+
| `retain_days` | `30` | Number of days to retain workflow runs before deletion. |
20+
| `keep_minimum_runs` | `6` | Minimum number of runs to keep per workflow. |
21+
| `delete_workflow_pattern` | (empty) | Target workflows by name or filename. Supports multiple filters separated by `\|`. Example: `build\|deploy` will match workflows with "build" OR "deploy" in name/filename. Omit to target all workflows. |
22+
| `delete_workflow_by_state_pattern` | (empty) | Filter workflows by state (comma-separated): `active`, `deleted`, `disabled_fork`, `disabled_inactivity`, `disabled_manually`. Omit to target all states. |
23+
| `delete_run_by_conclusion_pattern` | (empty) | Filter runs by conclusion (comma-separated): `action_required`, `cancelled`, `failure`, `skipped`, `success`. Omit to target all conclusions. |
24+
| `dry_run` | `false` | If `true`, simulate deletions and only log actions without performing them. |
25+
| `check_branch_existence` | `false` | If `true`, skip deletion for runs linked to an existing branch. Note: default branch (e.g., `main`) can be excluded from deletion checks as configured. |
26+
| `check_pullrequest_exist` | `false` | If `true`, skip deletion for runs linked to a pull request. |
27+
| `baseUrl` | (GitHub API base) | Optional GitHub Enterprise API base URL (e.g. `https://github.mycompany.com/api/v3`). Set when using GitHub Enterprise / GHES. |
2828

2929
Notes:
3030
- Inputs names reflect the action's expected input keys. Do not change names in your workflow unless you have updated the Action code accordingly.
@@ -84,18 +84,14 @@ on:
8484
inputs:
8585
days:
8686
description: "Days to retain runs"
87-
required: true
8887
default: "30"
8988
minimum_runs:
9089
description: "Minimum runs to keep"
91-
required: true
9290
default: "6"
9391
delete_workflow_pattern:
9492
description: "Workflow name or filename (omit for all). Use `|` to separate multiple filters (e.g. 'build|deploy')."
95-
required: false
9693
delete_workflow_by_state_pattern:
9794
description: "Workflow state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually"
98-
required: false
9995
default: "ALL"
10096
type: choice
10197
options:
@@ -106,7 +102,6 @@ on:
106102
- disabled_manually
107103
delete_run_by_conclusion_pattern:
108104
description: "Run conclusion: action_required, cancelled, failure, skipped, success"
109-
required: false
110105
default: "ALL"
111106
type: choice
112107
options:
@@ -119,7 +114,6 @@ on:
119114
- success
120115
dry_run:
121116
description: "Simulate deletions"
122-
required: false
123117
default: "false"
124118
type: choice
125119
options:
@@ -161,11 +155,9 @@ on:
161155
inputs:
162156
days:
163157
description: "Days to retain runs"
164-
required: true
165158
default: "30"
166159
minimum_runs:
167160
description: "Minimum runs to keep"
168-
required: true
169161
default: "6"
170162
jobs:
171163
delete-multiple-repos:
@@ -230,4 +222,4 @@ To build the Action locally:
230222

231223
## License
232224

233-
This project is licensed under the [MIT License](LICENSE).
225+
This project is licensed under the [MIT License](LICENSE).

action.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ author: "Mattraks"
44
inputs:
55
token:
66
description: "GitHub authentication token"
7-
required: true
7+
required: false
88
default: ${{ github.token }}
99
baseUrl:
1010
description: "GitHub API base URL (for GitHub Enterprise)"
1111
required: false
1212
default: "https://api.github.com"
1313
repository:
1414
description: "Repository name in {owner}/{repo} format"
15-
required: true
15+
required: false
1616
default: ${{ github.repository }}
1717
retain_days:
1818
description: "Number of days to retain workflow runs"
19-
required: true
19+
required: false
2020
default: "30"
2121
keep_minimum_runs:
2222
description: "Minimum number of runs to keep per workflow"
23-
required: true
23+
required: false
2424
default: "6"
2525
delete_workflow_pattern:
2626
description: "Workflow name or filename pattern (omit for all)"

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)