Skip to content

Commit 45a0b38

Browse files
committed
enh: update versions.json on tag, pacify git author
1 parent 03de126 commit 45a0b38

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/docs-build-update.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
ssh-key: "${{ secrets.NIPREPS_DEPLOY }}"
1717
fetch-depth: 0
1818

19-
- name: Determine current branch/tag name
19+
- name: Determine current branch/tag name & set-up git author
2020
run: |
2121
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
2222
CURBRANCH=${GITHUB_REF##*/}
@@ -32,6 +32,9 @@ jobs:
3232
echo "Building branch/tag ${CURBRANCH:-<unkwown>}, from git ref <$GITHUB_REF>"
3333
echo "CURBRANCH=${CURBRANCH}" >> ${GITHUB_ENV}
3434
35+
# Pacify git if we were to commit something
36+
git config user.email "[email protected]"
37+
git config user.email "NiPreps Bot"
3538
- name: Install GraphViz
3639
run: |
3740
sudo apt-get update -y
@@ -58,7 +61,10 @@ jobs:
5861
# It is fundamental that the directory does not exist at all.
5962
rm -rf ${MAJOR_MINOR}
6063
cp -r $HOME/docs/$CURBRANCH $PWD/${MAJOR_MINOR}
61-
git commit -am "rel(${CURBRANCH}): Update docs of ${MAJOR_MINOR} series" || true
64+
git add ${MAJOR_MINOR}
65+
python -c "from pathlib import Path; import json; f=Path('versions.json'); d=json.loads(f.read_text()); d['tags'].append(\"${MAJOR_MINOR}\"); d['tags'] = list(sorted(set(d['tags']))); f.write_text(json.dumps(d), indent=2); print('Updated versions.json')"
66+
git add versions.json
67+
git commit -m "rel(${CURBRANCH}): Update docs of ${MAJOR_MINOR} series" || true
6268
git push
6369
6470
- name: Push "master" docs to gh-pages after a PR is merged

0 commit comments

Comments
 (0)