File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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));
You can’t perform that action at this time.
0 commit comments