GithubHelp home page GithubHelp logo

ophub / delete-releases-workflows Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 9.0 39 KB

This Actions can delete the Releases and Workflows runs history of a specified repository.

License: GNU General Public License v2.0

Shell 100.00%
releases workflows actions delete

delete-releases-workflows's Introduction

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.

.github/workflows/*.yml 工作流脚本中引入此 Actions 即可使用,例如 delete.yml

- 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 <owner>/<repo> for the execution operation, the default is the current repository.
设置执行操作的 <owner>/<repo> ,默认为当前仓库
gh_token Required
必选项
Set the GITHUB_TOKEN password for executing the delete operation.
设置执行删除操作的 GITHUB_TOKEN 口令。
  • 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 / 链接

License / 许可

The delete-releases-workflows © OPHUB is licensed under GPL-2.0

delete-releases-workflows's People

Contributors

ophub avatar qwerttvv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

delete-releases-workflows's Issues

这是啥情况啊老哥

image

2024-03-03T05:44:11.0486550Z ##[warning]Unexpected input(s) 'del_releases', 'del_workflows', valid inputs are ['repo', 'delete_releases', 'delete_tags', 'prerelease_option', 'releases_keep_latest', 'releases_keep_keyword', 'delete_workflows', 'workflows_keep_day', 'workflows_keep_keyword', 'out_log', 'gh_token']
2024-03-03T05:44:11.0540622Z ##[group]Run ophub/delete-releases-workflows@main
2024-03-03T05:44:11.0541248Z with:
2024-03-03T05:44:11.0541686Z   del_releases: true
2024-03-03T05:44:11.0542228Z   releases_keep_latest: 0
2024-03-03T05:44:11.0542678Z   delete_tags: true
2024-03-03T05:44:11.0543148Z   del_workflows: true
2024-03-03T05:44:11.0543674Z   workflows_keep_day: 0
2024-03-03T05:44:11.0544501Z   gh_token: ***
2024-03-03T05:44:11.0544973Z   delete_releases: false
2024-03-03T05:44:11.0545550Z   prerelease_option: all
2024-03-03T05:44:11.0546025Z   delete_workflows: false
2024-03-03T05:44:11.0546730Z   out_log: false
2024-03-03T05:44:11.0547255Z ##[endgroup]
2024-03-03T05:44:11.0904407Z ##[group]Run cd ${GITHUB_ACTION_PATH}
2024-03-03T05:44:11.0904992Z �[36;1mcd ${GITHUB_ACTION_PATH}�[0m
2024-03-03T05:44:11.0905513Z �[36;1mecho -e "Current Actions path: ${PWD}"�[0m
2024-03-03T05:44:11.0906177Z �[36;1mecho -e "Current workflow run_id: ${GITHUB_RUN_ID}"�[0m
2024-03-03T05:44:11.0906743Z �[36;1m�[0m
2024-03-03T05:44:11.0907352Z �[36;1mgh_token="***"�[0m
2024-03-03T05:44:11.0908017Z �[36;1m[[ -z "${gh_token}" ]] && echo -e "Please set the token: [ gh_token ]." && exit 1�[0m
2024-03-03T05:44:11.0908725Z �[36;1mrepo=""�[0m
2024-03-03T05:44:11.0909159Z �[36;1m[[ -z "${repo}" ]] && repo="${GITHUB_REPOSITORY}"�[0m
2024-03-03T05:44:11.0909719Z �[36;1mout_log="false"�[0m
2024-03-03T05:44:11.0910070Z �[36;1m�[0m
2024-03-03T05:44:11.0910364Z �[36;1mdelete_releases="false"�[0m
2024-03-03T05:44:11.0911127Z �[36;1m[[ -z "${delete_releases}" ]] && echo -e "Please set whether to delete releases." && exit 1�[0m
2024-03-03T05:44:11.0911926Z �[36;1mdelete_tags="true"�[0m
2024-03-03T05:44:11.0912339Z �[36;1mprerelease_option="all"�[0m
2024-03-03T05:44:11.0912802Z �[36;1mreleases_keep_latest="0"�[0m
2024-03-03T05:44:11.0913262Z �[36;1mreleases_keep_keyword=""�[0m
2024-03-03T05:44:11.0913676Z �[36;1m�[0m
2024-03-03T05:44:11.0913992Z �[36;1mdelete_workflows="false"�[0m
2024-03-03T05:44:11.0914779Z �[36;1m[[ -z "${delete_workflows}" ]] && echo -e "Please set whether to delete workflows." && exit 1�[0m
2024-03-03T05:44:11.0915594Z �[36;1mworkflows_keep_day="0"�[0m
2024-03-03T05:44:11.0916030Z �[36;1mworkflows_keep_keyword=""�[0m
2024-03-03T05:44:11.0916460Z �[36;1m�[0m
2024-03-03T05:44:11.0916759Z �[36;1mmake_command=""�[0m
2024-03-03T05:44:11.0917295Z �[36;1m[[ -n "${repo}" ]] && make_command="${make_command} -r ${repo}"�[0m
2024-03-03T05:44:11.0918198Z �[36;1m[[ -n "${delete_releases}" ]] && make_command="${make_command} -a ${delete_releases}"�[0m
2024-03-03T05:44:11.0919180Z �[36;1m[[ -n "${delete_tags}" ]] && make_command="${make_command} -t ${delete_tags}"�[0m
2024-03-03T05:44:11.0920189Z �[36;1m[[ -n "${prerelease_option}" ]] && make_command="${make_command} -p ${prerelease_option}"�[0m
2024-03-03T05:44:11.0921310Z �[36;1m[[ -n "${releases_keep_latest}" ]] && make_command="${make_command} -l ${releases_keep_latest}"�[0m
2024-03-03T05:44:11.0922459Z �[36;1m[[ -n "${releases_keep_keyword}" ]] && make_command="${make_command} -w ${releases_keep_keyword}"�[0m
2024-03-03T05:44:11.0923575Z �[36;1m[[ -n "${delete_workflows}" ]] && make_command="${make_command} -s ${delete_workflows}"�[0m
2024-03-03T05:44:11.0924624Z �[36;1m[[ -n "${workflows_keep_day}" ]] && make_command="${make_command} -d ${workflows_keep_day}"�[0m
2024-03-03T05:44:11.0925992Z �[36;1m[[ -n "${workflows_keep_keyword}" ]] && make_command="${make_command} -k ${workflows_keep_keyword}"�[0m
2024-03-03T05:44:11.0927007Z �[36;1m[[ -n "${out_log}" ]] && make_command="${make_command} -o ${out_log}"�[0m
2024-03-03T05:44:11.0927866Z �[36;1m[[ -n "${gh_token}" ]] && make_command="${make_command} -g ${gh_token}"�[0m
2024-03-03T05:44:11.0928822Z �[36;1mchmod +x del.sh�[0m
2024-03-03T05:44:11.0929231Z �[36;1m./del.sh ${make_command}�[0m
2024-03-03T05:44:11.0956056Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2024-03-03T05:44:11.0956671Z ##[endgroup]
2024-03-03T05:44:11.1006584Z Current Actions path: /home/runner/work/_actions/ophub/delete-releases-workflows/main
2024-03-03T05:44:11.1008679Z Current workflow run_id: 8128119837
2024-03-03T05:44:11.1071716Z [�[95m STEPS �[0m] Welcome to use the delete older releases and workflow runs tool!
2024-03-03T05:44:11.1074067Z [�[95m STEPS �[0m] Start Initializing Variables...
2024-03-03T05:44:16.9723518Z [�[94m INFO �[0m] repo: [ qwerttvv/test ]
2024-03-03T05:44:16.9724489Z [�[94m INFO �[0m] delete_releases: [ false ]
2024-03-03T05:44:16.9725623Z [�[94m INFO �[0m] delete_tags: [ true ]
2024-03-03T05:44:16.9726404Z [�[94m INFO �[0m] prerelease_option: [ all ]
2024-03-03T05:44:16.9727187Z [�[94m INFO �[0m] releases_keep_latest: [ 0 ]
2024-03-03T05:44:16.9765975Z [�[94m INFO �[0m] releases_keep_keyword: [  ]
2024-03-03T05:44:16.9769764Z [�[94m INFO �[0m] delete_workflows: [ false ]
2024-03-03T05:44:16.9770560Z [�[94m INFO �[0m] workflows_keep_day: [ 0 ]
2024-03-03T05:44:16.9799870Z [�[94m INFO �[0m] workflows_keep_keyword: [  ]
2024-03-03T05:44:16.9805097Z [�[94m INFO �[0m] out_log: [ false ]
2024-03-03T05:44:16.9805876Z 
2024-03-03T05:44:16.9806571Z [�[95m STEPS �[0m] Do not delete releases and tags.
2024-03-03T05:44:16.9807727Z [�[95m STEPS �[0m] Do not delete workflows.
2024-03-03T05:44:16.9808651Z [�[92m SUCCESS �[0m] All process completed successfully.

和私库有关吗?我先私库试试,结果啥也没删

添加只删除prerelease功能

release可以修改类型为pre-releaselatest release
日常构建可以标记为 pre-release,需要长期保留的版本可以修改为latest release 在action执行的时候跳过清理这些版本

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.