Skip to content

Commit 73d6789

Browse files
authored
Update wiki.yml
1 parent 25a7c64 commit 73d6789

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/wiki.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ jobs:
5858
echo "wiki_changed=$changed" >> "$GITHUB_OUTPUT"
5959
exit 0
6060
fi
61+
62+
default_branch="$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"
63+
64+
if [ -z "$default_branch" ]; then
65+
default_branch="main"
66+
fi
6167

6268
git config user.email "github-actions[bot]@users.noreply.github.com"
6369
git config user.name "github-actions[bot]"
@@ -70,7 +76,7 @@ jobs:
7076
fi
7177

7278
git commit -m "Update wiki docs at $(date "+%Y-%m-%d %H:%M:%S")"
73-
git push origin HEAD
79+
git push origin "$default_branch"
7480

7581
changed="true"
7682
echo "wiki_changed=$changed" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)