From e6d6f29e0c88bff5d7a847d611a18d1c1352fa36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 17 Mar 2026 19:26:10 +0100 Subject: [PATCH] check new json file --- .../workflows/update_available_software.yml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update_available_software.yml b/.github/workflows/update_available_software.yml index 24c0b1ec0d..61f0b2b773 100644 --- a/.github/workflows/update_available_software.yml +++ b/.github/workflows/update_available_software.yml @@ -31,35 +31,35 @@ jobs: pip install -r scripts/available_software/requirements.txt # copy current JSON data, so we can compare after updating it - cp docs/available_software/data/json_data.json docs/available_software/data/json_data.json.orig - cp docs/available_software/data/json_data_detail.json docs/available_software/data/json_data_detail.json.orig + json_file=docs/available_software/data/eessi_api_metadata_software.json + json_file_orig=${json_file}.orig + cp ${json_file} ${json_file_orig} # download https://eessi.io/api_data/data/eessi_api_metadata_software.json # to where it's expected by docs/available_software/macros.py and scripts/available_software/available_software.py - cd docs/available_software/data/ + cd docs/available_software/data curl -OL https://eessi.io/api_data/data/eessi_api_metadata_software.json cd - export TIME_GENERATED_TEMPLATE="{{ generated_time }}" python scripts/available_software/available_software.py ./scripts/update_generated_time.sh mkdocs.yml - + git status # determine whether pull request should be opened: # if JSON files in docs/available_software/data have been updated, then a PR should be opened - json_data_changed=$(python scripts/available_software/check_json_updates.py docs/available_software/data/json_data.json.orig docs/available_software/data/json_data.json) - json_data_detail_changed=$(python scripts/available_software/check_json_updates.py docs/available_software/data/json_data_detail.json.orig docs/available_software/data/json_data_detail.json) - if [[ ${json_data_changed} == "no changes" ]] && [[ ${json_data_detail_changed} == "no changes" ]]; then - echo "JSON files in docs/available_software/data have not been changed, no need to open PR" + json_data_changed=$(python scripts/available_software/check_json_updates.py ${json_file_orig} ${json_file}) + if [[ ${json_data_changed} == "no changes" ]]; then + echo "JSON file ${json_file} has not been changed, no need to open PR" echo "json_data_changed=no" >> $GITHUB_OUTPUT else - echo "JSON files in docs/available_software/data have been changed, PR should be opened" + echo "JSON file ${json_file} has been changed, PR should be opened" echo "json_data_changed=yes" >> $GITHUB_OUTPUT fi - # remove original JSON files, or they'll end up in the PR being opened - rm -f docs/available_software/data/json_data.json.orig docs/available_software/data/json_data_detail.json.orig + # remove original JSON file, or it'll end up in the PR being opened + rm -f ${json_file_orig} - name: create pull request uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8