-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
username="QiubyZ" # Ganti dengan username GitHub kamu | ||
repository="apk-autorelease" # Ganti dengan nama repository kamu | ||
|
||
gh api graphql -F username="$username" -F reponame="$repository" -f ' | ||
query($username: String!, $reponame: String!) { | ||
repository(owner: $username, name: $reponame) { | ||
refs(refPrefix: "refs/tags/", first: 100) { | ||
nodes { | ||
name | ||
} | ||
} | ||
} | ||
} | ||
' --jq '.data.repository.refs.nodes[].name' | while read -r tag; do | ||
gh tag delete --force "$tag" | ||
echo "Tag '$tag' berhasil dihapus." | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import requests | ||
|
||
# Ganti dengan informasi Anda | ||
username = "QiubyZ" | ||
repo = "apk-autorelease" | ||
token = "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" | ||
|
||
headers = {"Authorization": f"token {token}"} | ||
|
||
# Hapus semua rilis | ||
releases_url = f"https://api.github.com/repos/{username}/{repo}/releases" | ||
releases = requests.get(releases_url, headers=headers).json() | ||
for release in releases: | ||
release_id = release["id"] | ||
delete_url = f"https://api.github.com/repos/{username}/{repo}/releases/{release_id}" | ||
requests.delete(delete_url, headers=headers) | ||
|
||
# Hapus semua tag | ||
tags_url = f"https://api.github.com/repos/{username}/{repo}/tags" | ||
tags = requests.get(tags_url, headers=headers).json() | ||
for tag in tags: | ||
tag_name = tag["name"] | ||
delete_url = f"https://api.github.com/repos/{username}/{repo}/git/refs/tags/{tag_name}" | ||
requests.delete(delete_url, headers=headers) | ||
|
||
print("Semua rilis dan tag telah dihapus.") |