Skip to content

Commit 23087e9

Browse files
author
Peter Somhorst
committed
Update workflow to set git user and push with token
1 parent 17a57c0 commit 23087e9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/test_build_documentation.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- main
1212
- develop
1313

14+
permissions:
15+
pages: write
16+
1417
jobs:
1518
build-docs:
1619
if: github.event.pull_request.draft == false
@@ -30,11 +33,14 @@ jobs:
3033
extract-data: false
3134
python-version: "3.10"
3235
- name: Build documentation
36+
if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main') }}
3337
run: |
3438
ln -s ../../notebooks docs/examples
3539
mkdocs build
3640
- name: Deploy documentation
3741
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
3842
run: |
39-
GIT_COMMITTER_NAME=ci-bot GIT_COMMITTER_EMAIL=ci-bot@github.com \
43+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
44+
git config --local user.name "github-actions[bot]"
45+
git remote set-url origin https://x-access-token:${GH_PAT}@github.com/${GITHUB_REPOSITORY}.git
4046
mike deploy --push --update-aliases $(git describe --tags --abbrev=0 | sed -E 's/^([vV]?[0-9]+\.[0-9]+).*/\1/') latest

0 commit comments

Comments
 (0)