Skip to content

Commit

Permalink
[Add] check if wiki is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
JanGalek committed Jan 5, 2025
1 parent 77b62c4 commit 8b01b44
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,20 @@ runs:

- name: Clone Wiki Repository
run: |
git clone https://x-access-token:${{ env.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git ./wiki
git clone https://x-access-token:${{ env.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git ./wiki || echo "Wiki repository not found."
shell: bash

- name: Sync Docs to Wiki
run: |
if [ ! -d "./wiki/.git" ]; then
echo "Create first page (init) https://github.com/${{ github.repository }}/wiki/_new"
exit 1
fi
if [ ! -d "./${{ inputs.dir }}" ]; then
echo "Directory ${{ inputs.dir }} does not exists."
mkdir ${{ inputs.dir }}
fi
cp -R ${{ inputs.dir }} wiki/
shell: bash
env:
Expand Down

0 comments on commit 8b01b44

Please sign in to comment.