Skip to content

Commit 1942833

Browse files
committed
fixing scrape evals job to also set/build dept filter
1 parent 70c290b commit 1942833

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/imports.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,22 @@ jobs:
208208
EVAL_SCRAPE_RETRY_BACKOFF_MS: "1000"
209209
EVAL_RANDOMIZE_ORDER: "true"
210210
INPUT_TERM: ${{ inputs.term }}
211+
INPUT_SUBJECT: ${{ inputs.subject }}
211212
PHPSESSID: ${{ inputs.php_sessid }}
212213
run: |
213214
if [ -z "${PHPSESSID}" ]; then
214215
echo "php_sessid input is required to run evaluations" >&2
215216
exit 1
216217
fi
217218
echo "::add-mask::${PHPSESSID}"
218-
if [ -n "$INPUT_TERM" ]; then
219-
export EVAL_QUERY=$(node -e 'const term=process.env.INPUT_TERM; const q={semester:Number(term), "scores.Quality of Course": {"$exists": false}}; console.log(JSON.stringify(q));')
220-
else
221-
export EVAL_QUERY='{"scores.Quality of Course": {"$exists": false}}'
222-
fi
219+
export EVAL_QUERY=$(node -e '
220+
const term = process.env.INPUT_TERM;
221+
const subj = process.env.INPUT_SUBJECT;
222+
const q = { "scores.Quality of Course": { "$exists": false } };
223+
if (term) q.semester = Number(term);
224+
if (subj) q.department = String(subj).toUpperCase();
225+
console.log(JSON.stringify(q));
226+
')
223227
node importers/scrapeEvaluations.js --skip
224228
225229
backfill_scores:

0 commit comments

Comments
 (0)