Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/update_available_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading