From bebbcc93c2b35aa81a60efe57f901a81d8429675 Mon Sep 17 00:00:00 2001 From: Luca Lanziani Date: Thu, 6 Jun 2024 09:00:53 +0200 Subject: [PATCH] [chore] Do not fail if JSON is not found in previous issue (#33395) **Description:** Avoid crashing when JSON section is not present in previous ISSUE **Link to tracking Issue:** #33388 **Testing:** ``` act -j get_issues -e <(echo '{"repository": {"owner": {"login": "your-github-username"}}}') -s GITHUB_TOKEN= ``` --- .github/workflows/scripts/generate-weekly-report.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/generate-weekly-report.js b/.github/workflows/scripts/generate-weekly-report.js index 45b463357f65..9ce8fa282853 100644 --- a/.github/workflows/scripts/generate-weekly-report.js +++ b/.github/workflows/scripts/generate-weekly-report.js @@ -285,7 +285,8 @@ function parseJsonFromText(text) { // Parse the found string to JSON return JSON.parse(match[1]); } else { - throw new Error("JSON data not found"); + debug({msg: "No JSON found in previous issue"}) + return null } }