Skip to content

Commit d2eeef3

Browse files
authored
Merge pull request #706 from bedroge/software_overview_check
Fix check in CI for detecting changes in software-specific pages
2 parents c02bdf7 + adde75b commit d2eeef3

3 files changed

Lines changed: 7 additions & 15 deletions

File tree

.github/workflows/update_available_software.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ jobs:
3030
. venv/bin/activate
3131
pip install -r scripts/available_software/requirements.txt
3232
33-
# copy current JSON data, so we can compare after updating it
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}
37-
3833
# download https://eessi.io/api_data/data/eessi_api_metadata_software.json
3934
# to where it's expected by docs/available_software/macros.py and scripts/available_software/available_software.py
4035
cd docs/available_software/data
@@ -48,18 +43,17 @@ jobs:
4843
git status
4944
5045
# determine whether pull request should be opened:
51-
# if JSON files in docs/available_software/data have been updated, then a PR should be opened
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"
55-
echo "json_data_changed=no" >> $GITHUB_OUTPUT
56-
else
57-
echo "JSON file ${json_file} has been changed, PR should be opened"
46+
# if detailed software pages in docs/available_software/detail have been updated, then a PR should be opened
47+
if [[ $(git status --porcelain ./docs/available_software/detail) ]]; then
48+
echo "Software pages have been changed, PR should be opened"
5849
echo "json_data_changed=yes" >> $GITHUB_OUTPUT
50+
else
51+
echo "Software pages have not been changed, no need to open PR"
52+
echo "json_data_changed=no" >> $GITHUB_OUTPUT
5953
fi
6054
6155
# remove original JSON file, or it'll end up in the PR being opened
62-
rm -f ${json_file_orig}
56+
rm -f docs/available_software/data/eessi_api_metadata_software.json
6357
6458
- name: create pull request
6559
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8

0 commit comments

Comments
 (0)