Skip to content

Commit

Permalink
More documentation auto-building (#478)
Browse files Browse the repository at this point in the history
* Make Git configuration global; suppress Git output about initial branch name

* Use full form of the name for clarity
  • Loading branch information
mdickinson committed Aug 2, 2021
1 parent 5f74a1d commit 139c2f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
python -m pip install .[docs]
- name: Configure Git
run: |
git config user.name "Documentation Bot"
git config user.email "<>"
git config --global user.name "Documentation Bot"
git config --global user.email "<>"
- name: Build documentation and deploy to gh-pages
run: |
python scripts/update_docs.py --token ${{ secrets.GITHUB_TOKEN }} ${{ github.ref }}
4 changes: 3 additions & 1 deletion scripts/update_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ def clone_branch(repo, branch, target_directory, name):
clone_directory = os.path.join(target_directory, name)
os.mkdir(clone_directory)
with current_directory(clone_directory):
run_git("init")
# Specify a branch name to silence Git's output about the master->main
# change.
run_git("init", "--initial-branch=main")
run_git("remote", "add", "origin", repo)
run_git("fetch", "--no-tags", "--prune", "--depth=1", "origin", branch)
run_git("checkout", branch)
Expand Down

0 comments on commit 139c2f3

Please sign in to comment.