Cara hapus nya adalah dengan menghapus actions nya satu persatu. Kalau sedikit mah gampang, sekarang pas udah numpuk, pegel juga hapus satu persatu.
Saya dapat cara yang efektif ini dari stackoverflow - anyone know a way to delete worflow from github actions
-
Install
github-cli
-
Install jq (command-line JSON processor),
apt install jq
-
Untuk test github cli, gunakan
gh api repos/namauserataugroup/namarepo/actions/workflows
Test github-cli, List Semua Workflows
-
Disable Workflows yang ingin di hapus
Disable Workflows di Repo
-
Buat 1 script dengan nama
remove-old-actions.sh
, isikan dengan
org=namagroupataunamausername
repo=namarepo
# Get workflow IDs with status "disabled_manually"
workflow_ids=($(gh api repos/$org/$repo/actions/workflows | jq '.workflows[] | select(.["state"] | contains("disabled_manually")) | .id'))
for workflow_id in "${workflow_ids[@]}"
do
echo "Listing runs for the workflow ID $workflow_id"
run_ids=( $(gh api repos/$org/$repo/actions/workflows/$workflow_id/runs | jq '.workflow_runs[].id') )
for run_id in "${run_ids[@]}"
do
echo "Deleting Run ID $run_id"
gh api repos/$org/$repo/actions/runs/$run_id -X DELETE >/dev/null
done
done
-
Jalankan
while :; do clear; source remove-old-actions; sleep 10; done
Proses Hapus Workflows
-
Apabila sudah tidak ada proses, silahkan tekan ctrl+c
Sumber:
stackoverflow - anyone know a way to delete worflow from github actions