Skip to content

Commit 5ecffde

Browse files
committed
Fixing 'list gists for user'
1 parent 6dfb780 commit 5ecffde

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

components/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export default {
3636
let page = 1;
3737
const data = [];
3838

39-
const date = new Date(this.since);
40-
if (isNaN(date.getTime())) {
39+
const date = this.since && new Date(this.since);
40+
if (date && isNaN(date.getTime())) {
4141
throw new ConfigurationError("Invalid date string provided");
4242
}
4343

44-
const since = date.toISOString();
44+
const since = date?.toISOString();
4545

4646
while (true) {
4747
const res = await this.github.listGistsFromUser(this.username, {
@@ -62,11 +62,11 @@ export default {
6262
}
6363

6464
if (data.length === 0) {
65-
$.export("$summary", `No gists found for user "${this.username}".`);
65+
$.export("$summary", `No gists found for user "${this.username}"`);
6666
return;
6767
}
6868

69-
$.export("$summary", `Successfully fetched ${data.length} gist(s).`);
69+
$.export("$summary", `Successfully fetched ${data.length} gist(s)`);
7070
return data;
7171
},
7272
};

0 commit comments

Comments
 (0)