Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add release deletion acceptance test
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cd6661ad-7e77-46d0-b0e7-0a296f4e252b
  • Loading branch information
williammartin and Copilot committed Aug 5, 2026
commit 0b9f913f469538035e06bdd25cbbbb5845a7191c
38 changes: 38 additions & 0 deletions acceptance/testdata/release/release-delete.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private

# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING

# Create a release in the repo
exec gh release create v1.2.3 --repo $ORG/$SCRIPT_NAME-$RANDOM_STRING --notes 'awesome release' --latest

# Upload an asset to the release
exec gh release upload v1.2.3 --repo $ORG/$SCRIPT_NAME-$RANDOM_STRING asset.txt

# Delete the asset from the release
exec gh release delete-asset v1.2.3 asset.txt --repo $ORG/$SCRIPT_NAME-$RANDOM_STRING --yes

# Verify the release has no assets
exec gh release view v1.2.3 --repo $ORG/$SCRIPT_NAME-$RANDOM_STRING --json assets --jq '.assets | length'
stdout '0'

# Downloading the deleted asset should fail
! exec gh release download v1.2.3 --repo $ORG/$SCRIPT_NAME-$RANDOM_STRING
stderr 'no assets to download'

# Delete the release and its tag
exec gh release delete v1.2.3 --repo $ORG/$SCRIPT_NAME-$RANDOM_STRING --yes --cleanup-tag

# Give the tag cleanup time to propagate
sleep 5

# Verify the release is gone
! exec gh release view v1.2.3 --repo $ORG/$SCRIPT_NAME-$RANDOM_STRING

# Verify the tag is gone
! exec gh api repos/$ORG/$SCRIPT_NAME-$RANDOM_STRING/git/ref/tags/v1.2.3
stderr 'Not Found'

-- asset.txt --
Hello, world!