Skip to content

Commit 2a18e6f

Browse files
committed
Correction to publish_docs workflow for branches
The github `actions/checkout@v4` only tracks the current branch, even when `fetch-depth: 0` is used, this causes branch names other than the current one to be missed when creating the html navigation menus. This is solved by adding a step to track all of the remote branches that were fetched during checkout. Signed-off-by: Winford <winford@object.stream>
1 parent 97caac1 commit 2a18e6f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/build-docs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ jobs:
9191
repository: ${{ vars.GITHUB_REPOSITORY }}
9292
fetch-depth: 0
9393

94+
- name: Track all branches
95+
shell: bash
96+
run: |
97+
git config --global --add safe.directory /__w/AtomVM/AtomVM
98+
for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}"`; do
99+
git branch --track ${branch#remotes/origin/} $branch
100+
done
101+
94102
- name: Build Site
95103
shell: bash
96104
run: |

.github/workflows/publish-docs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ jobs:
9898
ref: Production
9999
path: /home/runner/work/AtomVM/AtomVM/www
100100

101+
- name: Track all branches
102+
shell: bash
103+
run: |
104+
git config --global --add safe.directory /__w/AtomVM/AtomVM
105+
for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}" `; do
106+
git branch --track ${branch#remotes/origin/} $branch
107+
done
108+
101109
- name: Build Site
102110
shell: bash
103111
run: |

0 commit comments

Comments
 (0)