From 3e0b7bb73b442f0b6f2c0c9de30f704b54fe6d13 Mon Sep 17 00:00:00 2001 From: dansand Date: Mon, 20 May 2024 16:52:46 +1000 Subject: [PATCH] safeguards for missing keywords --- .github/scripts/write_repo_contents.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/scripts/write_repo_contents.py b/.github/scripts/write_repo_contents.py index b5654c9..fd9fbb8 100644 --- a/.github/scripts/write_repo_contents.py +++ b/.github/scripts/write_repo_contents.py @@ -174,9 +174,10 @@ ####### # Add issue keywords as repository topics -keywords = data["scientific_keywords"] -if data["software"]["keywords"]: - keywords += data["software"]["keywords"] +keywords = [] +sciencekeywords = issue_dict.get("scientific_keywords", []) +softwarekeywords = issue_dict["software"].get("keywords", []) +keywords += sciencekeywords + softwarekeywords #ensure keywords have valid format def sanitize_string(s):