From 6c343b5d367439f05ea39e2179b809592475bca9 Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Mon, 30 Dec 2024 21:47:49 +0530 Subject: [PATCH 1/2] Update github repository push Signed-off-by: Abhinav Pandey --- .github/workflows/book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index 14e14c75d0..60fedf5075 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -52,7 +52,7 @@ jobs: path: book_source/_book/ # download documentation repo - name: Checkout documentation repo - if: github.event_name == 'push' + if: github.event_name == 'push' && github.repository == 'pecanProject/pecan' uses: actions/checkout@v4 with: repository: ${{ github.repository_owner }}/pecan-documentation From d99113ac6e7d3eaa1cfdff9c4d39256553396209 Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Sun, 5 Jan 2025 14:42:34 +0530 Subject: [PATCH 2/2] Fetch Documentation repo conditionally as recommended by @infotroph --- .github/workflows/book.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index 60fedf5075..ce4977feb6 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -50,9 +50,18 @@ jobs: with: name: pecan-documentation path: book_source/_book/ + # check if documentation repo exists + - name: Check if documentation repo exists + id: doc_exists + run: | + if git ls-remote https://github.com/${{ github.repository_owner }}/pecan-documentation.git > /dev/null 2>&1; then + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "exists=false" >> $GITHUB_OUTPUT + fi # download documentation repo - name: Checkout documentation repo - if: github.event_name == 'push' && github.repository == 'pecanProject/pecan' + if: ${{ github.event_name == 'push' && steps.doc_exists.outputs.exists == 'true' }} uses: actions/checkout@v4 with: repository: ${{ github.repository_owner }}/pecan-documentation