Skip to content

Commit c02bdf7

Browse files
authored
Merge pull request #704 from bedroge/fix_software_overview_ci
Fix check for software overview page updates
2 parents 6c218ca + e6d6f29 commit c02bdf7

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/update_available_software.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,35 @@ jobs:
3131
pip install -r scripts/available_software/requirements.txt
3232
3333
# copy current JSON data, so we can compare after updating it
34-
cp docs/available_software/data/json_data.json docs/available_software/data/json_data.json.orig
35-
cp docs/available_software/data/json_data_detail.json docs/available_software/data/json_data_detail.json.orig
34+
json_file=docs/available_software/data/eessi_api_metadata_software.json
35+
json_file_orig=${json_file}.orig
36+
cp ${json_file} ${json_file_orig}
3637
3738
# download https://eessi.io/api_data/data/eessi_api_metadata_software.json
3839
# to where it's expected by docs/available_software/macros.py and scripts/available_software/available_software.py
39-
cd docs/available_software/data/
40+
cd docs/available_software/data
4041
curl -OL https://eessi.io/api_data/data/eessi_api_metadata_software.json
4142
cd -
4243
4344
export TIME_GENERATED_TEMPLATE="{{ generated_time }}"
4445
python scripts/available_software/available_software.py
4546
./scripts/update_generated_time.sh mkdocs.yml
46-
47+
4748
git status
4849
4950
# determine whether pull request should be opened:
5051
# if JSON files in docs/available_software/data have been updated, then a PR should be opened
51-
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)
52-
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)
53-
if [[ ${json_data_changed} == "no changes" ]] && [[ ${json_data_detail_changed} == "no changes" ]]; then
54-
echo "JSON files in docs/available_software/data have not been changed, no need to open PR"
52+
json_data_changed=$(python scripts/available_software/check_json_updates.py ${json_file_orig} ${json_file})
53+
if [[ ${json_data_changed} == "no changes" ]]; then
54+
echo "JSON file ${json_file} has not been changed, no need to open PR"
5555
echo "json_data_changed=no" >> $GITHUB_OUTPUT
5656
else
57-
echo "JSON files in docs/available_software/data have been changed, PR should be opened"
57+
echo "JSON file ${json_file} has been changed, PR should be opened"
5858
echo "json_data_changed=yes" >> $GITHUB_OUTPUT
5959
fi
6060
61-
# remove original JSON files, or they'll end up in the PR being opened
62-
rm -f docs/available_software/data/json_data.json.orig docs/available_software/data/json_data_detail.json.orig
61+
# remove original JSON file, or it'll end up in the PR being opened
62+
rm -f ${json_file_orig}
6363
6464
- name: create pull request
6565
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8

0 commit comments

Comments
 (0)