|
10 | 10 | runs-on: ubuntu-latest
|
11 | 11 |
|
12 | 12 | permissions:
|
13 | | - contents: write # Grant permissions to write content to the repository |
| 13 | + contents: write # Ensure the job has write permissions |
14 | 14 |
|
15 | 15 | steps:
|
16 | 16 | - name: Checkout the Linear_Algebra_with_Python repository
|
|
50 | 50 | sed -i '/<section class="table-of-contents">/,/<\/section>/{//!d}' book_repo/linear-algebra-with-python-book/index.html
|
51 | 51 | sed -i "/<section class=\"table-of-contents\">/a $toc" book_repo/linear-algebra-with-python-book/index.html
|
52 | 52 |
|
53 | | - - name: Set up Git remote with PAT |
54 | | - run: | |
55 | | - cd book_repo |
56 | | - git remote set-url origin https://$GITHUB_ACTOR:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/weijie-chen/weijie-chen.github.io.git |
| 53 | + - name: Remove extraheader to avoid conflicts with PAT |
| 54 | + run: git config --unset-all http.https://github.com/.extraheader |
57 | 55 |
|
58 | 56 | - name: Commit and Push Changes
|
59 | 57 | run: |
|
|
63 | 61 | git add linear-algebra-with-python-book/chapters/*
|
64 | 62 | git add linear-algebra-with-python-book/index.html
|
65 | 63 | git commit -m "Updated chapters and Table of Contents"
|
66 | | - git push origin main:master |
| 64 | + git push origin main |
0 commit comments