Skip to content

Commit 4053f1f

Browse files
committed
Remove deletion of gist files by JAX offloading publish step
1 parent 8392a74 commit 4053f1f

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

.github/workflows/_finalize.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,24 +230,15 @@ jobs:
230230
const dstId = "${{ inputs.PUBLISH_BADGE && vars.BADGE_ENDPOINT_GIST_ID || vars.MOCK_BADGE_ENDPOINT_GIST_ID }}";
231231
const { PUBLISH_BADGE_FILES } = process.env;
232232
233-
// Fetch existing files from destination gist
234-
const { data: dstData } = await github.rest.gists.get({
235-
gist_id: dstId
236-
});
237-
238-
// Mark existing files in destination gist for deletion
239-
let filesToUpdate = {};
240-
for (const filename of Object.keys(dstData.files)) {
241-
filesToUpdate[filename] = null;
242-
}
243-
244233
// Fetch files from source gist
245234
const { data: srcData } = await github.rest.gists.get({
246235
gist_id: srcId
247236
});
248237
249238
// Add or update files based on the pattern
239+
let filesToUpdate = {};
250240
const pattern = new RegExp(`${PUBLISH_BADGE_FILES}`);
241+
251242
for (const [filename, fileObj] of Object.entries(srcData.files)) {
252243
if (filename.match(pattern)) {
253244
filesToUpdate[filename] = {
@@ -261,5 +252,6 @@ jobs:
261252
gist_id: dstId,
262253
files: filesToUpdate
263254
});
255+
264256
console.log("Files copied successfully.");
265257
console.log(Object.keys(filesToUpdate));

0 commit comments

Comments
 (0)