1717 python-version : ' 3.10'
1818 architecture : x64
1919
20- - name : Mount EESSI
21- uses : eessi/github-action-eessi@e1f8f20638ea417a18d23ab29443ee34794ff900 # v3.1.0
22- with :
23- eessi_stack_version : ' 2023.06'
24-
2520 - name : update overview of available software
2621 id : update_available_software
2722 run : |
@@ -30,30 +25,31 @@ jobs:
3025 . venv/bin/activate
3126 pip install -r scripts/available_software/requirements.txt
3227
33- # 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
28+ # download https://eessi.io/api_data/data/eessi_api_metadata_software.json
29+ # to where it's expected by docs/available_software/macros.py and scripts/available_software/available_software.py
30+ data_dir="docs/available_software/data"
31+ mkdir -p ${data_dir}
32+ cd ${data_dir}
33+ curl -OL https://eessi.io/api_data/data/eessi_api_metadata_software.json
34+ cd -
3635
37- export TIME_GENERATED_TEMPLATE="{{ generated_time }}"
3836 python scripts/available_software/available_software.py
3937 ./scripts/update_generated_time.sh mkdocs.yml
40-
38+
4139 git status
4240
4341 # determine whether pull request should be opened:
44- # if JSON files in docs/available_software/data have been updated, then a PR should be opened
45- 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)
46- 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)
47- if [[ ${json_data_changed} == "no changes" ]] && [[ ${json_data_detail_changed} == "no changes" ]]; then
48- echo "JSON files in docs/available_software/data have not been changed, no need to open PR"
49- echo "json_data_changed=no" >> $GITHUB_OUTPUT
50- else
51- echo "JSON files in docs/available_software/data have been changed, PR should be opened"
42+ # if detailed software pages in docs/available_software/detail have been updated, then a PR should be opened
43+ if [[ $(git status --porcelain ./docs/available_software/detail) ]]; then
44+ echo "Software pages have been changed, PR should be opened"
5245 echo "json_data_changed=yes" >> $GITHUB_OUTPUT
46+ else
47+ echo "Software pages have not been changed, no need to open PR"
48+ echo "json_data_changed=no" >> $GITHUB_OUTPUT
5349 fi
5450
55- # remove original JSON files , or they 'll end up in the PR being opened
56- rm -f docs/available_software/data/json_data .json.orig docs/available_software/data/json_data_detail.json.orig
51+ # remove the JSON file in the data directory , or it 'll end up in the PR being opened
52+ rm -r ${data_dir}/* .json
5753
5854 - name : create pull request
5955 uses : peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
0 commit comments