Agent skill
remove-release-assets
Remove all files/artifacts/assets from a GitHub release
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/remove-release-assets
SKILL.md
Remove Release Assets
Remove all files/artifacts/assets from a GitHub release.
Usage
Invoke this skill when you need to clear all assets from a release before uploading new ones.
Parameters
When invoking this skill, provide:
- repo: The repository (e.g.,
iNavFlight/inavoriNavFlight/inav-configurator) - tag: The release tag (e.g.,
9.0.0-RC2)
Procedure
- Get asset IDs from the release:
gh api repos/{repo}/releases --jq '.[] | select(.tag_name=="{tag}") | .assets[].id' > /tmp/asset_ids.txt
- Check how many assets exist:
wc -l /tmp/asset_ids.txt
- Delete each asset via the GitHub API:
count=0
total=$(wc -l < /tmp/asset_ids.txt)
while IFS= read -r id; do
((count++))
gh api -X DELETE "repos/{repo}/releases/assets/$id" 2>/dev/null && echo "Deleted $count/$total"
done < /tmp/asset_ids.txt
echo "Done"
- Verify deletion:
gh release view {tag} --repo {repo} --json assets --jq '.assets | length'
Should return 0.
Notes
- The
gh release delete-assetcommand does not exist in older versions ofgh, so we use the API directly - This works for both draft and published releases
- Assets are deleted immediately and cannot be recovered
- For large releases (100+ assets), this may take a few minutes
Example
To remove all assets from the INAV 9.0.0-RC2 draft release:
# Get asset IDs
gh api repos/iNavFlight/inav/releases --jq '.[] | select(.tag_name=="9.0.0-RC2") | .assets[].id' > /tmp/asset_ids.txt
# Delete all
while IFS= read -r id; do
gh api -X DELETE "repos/iNavFlight/inav/releases/assets/$id"
done < /tmp/asset_ids.txt
# Verify
gh release view 9.0.0-RC2 --repo iNavFlight/inav --json assets --jq '.assets | length'
Related Skills
- upload-release-assets - Upload new assets after removal
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?