From 3989e4b325fd35af0f19f42a37021d50b48b77e0 Mon Sep 17 00:00:00 2001 From: softprops Date: Mon, 6 May 2024 09:44:36 -0400 Subject: [PATCH] document impl detail --- src/github.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/github.ts b/src/github.ts index 22f7cfaa2..b9c0e1e45 100644 --- a/src/github.ts +++ b/src/github.ts @@ -149,6 +149,9 @@ export const upload = async ( const [owner, repo] = config.github_repository.split("/"); const { name, size, mime, data: body } = asset(path); const currentAsset = currentAssets.find( + // note: GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "List release assets" endpoint lists the renamed filenames. + // due to this renaming we need to be mindful when we compare the file name we're uploading with a name github may already have rewritten for logical comparison + // see https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset ({ name: currentName }) => currentName == name.replace(" ", ".") ); if (currentAsset) {