https://github.com/ophub/delete-releases-workflows
This Actions can delete the Releases and Workflows runs history of a specified repository.
https://github.com/ophub/delete-releases-workflows
actions delete releases workflows
Last synced: 2 months ago
JSON representation
This Actions can delete the Releases and Workflows runs history of a specified repository.
- Host: GitHub
- URL: https://github.com/ophub/delete-releases-workflows
- Owner: ophub
- License: gpl-2.0
- Created: 2023-01-08T10:50:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T11:43:46.000Z (3 months ago)
- Last Synced: 2025-04-10T02:49:07.577Z (2 months ago)
- Topics: actions, delete, releases, workflows
- Language: Shell
- Homepage:
- Size: 38.1 KB
- Stars: 11
- Watchers: 1
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Function description / 功能说明
This Actions can delete specified repository's Releases and Workflow run logs.
这个 Actions 可以删除指定仓库的 Releases 和 Workflows 运行记录。
## Instructions / 使用说明
You can use this Actions by introducing it in the `.github/workflows/*.yml` workflow script, such as in [delete.yml](https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/.github/workflows/delete-older-releases-workflows.yml).
在 `.github/workflows/*.yml` 工作流脚本中引入此 Actions 即可使用,例如 [delete.yml](https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/.github/workflows/delete-older-releases-workflows.yml)。
```yaml
- name: Delete releases and workflows runs
uses: ophub/delete-releases-workflows@main
with:
delete_releases: true
releases_keep_latest: 5
delete_workflows: true
workflows_keep_day: 10
gh_token: ${{ secrets.GITHUB_TOKEN }}
```## Setting instructions / 设置说明
You can configure the deletion settings in the delete.yml file with the following options:
您可以在 delete.yml 文件中使用以下选项配置删除设置:
| Key / 选项 | Required | Description / 说明 |
| ----------------------- | ---------- | ---------------------------------------- |
| delete_releases | `Required`
`必选项` | Set whether to delete releases files (options: `true`/`false`). The default is `false`.
设置是否删除 releases 文件(选项:`true`/`false`),默认为 `false`。 |
| prerelease_option | Optional
可选项 | Set whether to differentiate pre-release versions (options: `all`/`true`/`false`). `all` indicates all types, `true`/`false` represent only deleting releases files marked with this type. The default is `all`.
设置是否区分预发行版本(选项:`all`/`true`/`false`)。`all`表示全部类型,`true`/`false`代表仅删除标记为此类型的 releases 文件。默认为 `all`。 |
| releases_keep_latest | Optional
可选项 | Set how many of the latest Releases versions to keep (`integer`, such as: 5). Setting to `0` means delete all, and the default is to keep `90`.
设置保留几个最新的 Releases 版本(`整数`。如:5),设置为 `0` 表示全部删除,默认保留 `90` 个。 |
| releases_keep_keyword | Optional
可选项 | Set the `keywords` of the Releases' tags to be preserved. Multiple keywords are separated by `/` (for example: `book/tool`). The default value is `none`.
设置需要保留的 Releases 的 tags `关键字`,多个关键字使用 `/` 分割(例如:`book/tool`),默认值 `无`。 |
| delete_tags | Optional
可选项 | Set whether to delete the tags associated with Releases (options: `true`/`false`). The default is `false`.
设置是否删除与 Releases 关联的 tags(选项:`true`/`false`),默认为 `false`。 |
| delete_workflows | `Required`
`必选项` | Set whether to delete workflow run logs (options: `true`/`false`). The default is `false`.
设置是否删除 workflows 运行记录(选项:`true`/`false`),默认为 `false`。 |
| workflows_keep_day | Optional
可选项 | Set how many days' workflow logs to keep (`integer`, such as: 30). Setting to `0` means delete all. The default is `90` days.
设置保留几天以内的 workflows 记录(`整数`。如:30),设置为 `0` 表示全部删除。默认为 `90` 天。 |
| workflows_keep_keyword | Optional
可选项 | Set the `keywords` for the names of the workflow run logs to be kept. Multiple keywords are separated by `/` (for example: `book/tool`). The default value is `none`.
设置需要保留的 workflows 运行记录的名称`关键字`,多个关键字使用 `/` 分割(例如:`book/tool`),默认值 `无`。 |
| out_log | Optional
可选项 | Set whether to output detailed json logs (options: `true`/`false`). The default value is `false`.
设置是否输出详细的 json 日志(选项:`true`/`false`),默认值 `false`。 |
| repo | Optional
可选项 | Set the `/` for the execution operation, the default is the `current repository`.
设置执行操作的 `/` ,默认为`当前仓库`。 |
| gh_token | `Required`
`必选项` | Set the [GITHUB_TOKEN](https://docs.github.com/en/actions/security-guides/automatic-token-authentication) password for executing the delete operation.
设置执行删除操作的 [GITHUB_TOKEN](https://docs.github.com/zh/actions/security-guides/automatic-token-authentication#about-the-github_token-secret) 口令。 |- Each run can delete up to 1000 Releases and 1000 Workflow run logs. If there are more records, the delete operation needs to be run multiple times.
- 每次运行可以删除 1000 个 Releases 和 1000 个 Workflows 运行记录,如有更多记录,需要多次运行删除操作。## Links / 链接
- [GitHub Docs](https://docs.github.com/en/rest/releases/releases?list-releases)
- [unifreq/openwrt_packit](https://github.com/unifreq/openwrt_packit)
- [amlogic-s9xxx-armbian](https://github.com/ophub/amlogic-s9xxx-armbian)
- [amlogic-s9xxx-openwrt](https://github.com/ophub/amlogic-s9xxx-openwrt)
- [flippy-openwrt-actions](https://github.com/ophub/flippy-openwrt-actions)## License / 许可
The delete-releases-workflows © OPHUB is licensed under [GPL-2.0](https://github.com/ophub/delete-releases-workflows/blob/main/LICENSE)