Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pngwn committed Aug 5, 2024
1 parent 5b27b31 commit 876458d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@gradio-action/set-commit-status",
"name": "@gradio-action/copy-demos",
"version": "0.1.0",
"description": "",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/filter-paths/action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "filter paths"

inputs:
name:
filter:
description: "Name of the filter to apply"
required: true
path:
Expand Down
11 changes: 3 additions & 8 deletions packages/filter-paths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,20 @@ async function run() {
run();

function parse_data(data: any): any[] {
// If the data is an array, return that
if (Array.isArray(data)) {
return data;
}

// Some endpoints respond with 204 No Content instead of empty array
// when there is no data. In that case, return an empty array.
if (!data) {
return [];
}

// Otherwise, the array of items that we want is in an object
// Delete keys that don't include the array of items
delete data.incomplete_results;
delete data.repository_selection;
delete data.total_count;
// Pull out the array of items
const namespaceKey = Object.keys(data)[0];
data = data[namespaceKey];

const namespace_key = Object.keys(data)[0];
data = data[namespace_key];

return data;
}

0 comments on commit 876458d

Please sign in to comment.