Skip to content

Commit 9cc2590

Browse files
AddonoCopilot
andcommitted
feat: add title and description to gh-attach-assets release
When the release-asset strategy creates the dummy release for the first time, it now sets a clear title ('gh-attach image assets') and a body that explains the release is used as asset storage and should not be deleted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b7a0e12 commit 9cc2590

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

openspec/specs/core/spec.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ The system SHALL support uploading images as GitHub release assets via the offic
8080
- AND no existing image-assets release in the target repository
8181
- WHEN `upload(file, target)` is called
8282
- THEN the system SHALL create a prerelease (non-draft) tagged `_gh-attach-assets`
83+
- AND the release SHALL have the title `"gh-attach image assets"`
84+
- AND the release SHALL have a body explaining it is a dummy release used by gh-attach as storage for image assets, and that it should not be deleted
8385
- AND upload the image as a release asset
8486
- AND return the asset download URL
8587

src/core/strategies/releaseAsset.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ async function findOrCreateAssetsRelease(
141141
owner: target.owner,
142142
repo: target.repo,
143143
tag_name: ASSETS_TAG,
144-
name: "Image Assets",
144+
name: "gh-attach image assets",
145+
body: "This is a dummy release used by [gh-attach](https://github.com/Addono/gh-attach) as storage for image assets attached to issues and pull requests.\n\n> [!WARNING]\n> Do not delete this release or its assets — doing so will break image embeds that reference them.",
145146
draft: false,
146147
prerelease: true,
147148
});

test/unit/core/strategies/releaseAsset.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ describe("Release Asset Strategy", () => {
166166
owner: mockTarget.owner,
167167
repo: mockTarget.repo,
168168
tag_name: "_gh-attach-assets",
169-
name: "Image Assets",
169+
name: "gh-attach image assets",
170+
body: "This is a dummy release used by [gh-attach](https://github.com/Addono/gh-attach) as storage for image assets attached to issues and pull requests.\n\n> [!WARNING]\n> Do not delete this release or its assets — doing so will break image embeds that reference them.",
170171
draft: false,
171172
prerelease: true,
172173
},

0 commit comments

Comments
 (0)