From 5b2c6e3b80b011195d76b8e4cc356bb60143017e Mon Sep 17 00:00:00 2001 From: ClementMabileau Date: Sun, 5 May 2024 02:38:42 +0200 Subject: [PATCH] Fix unexpected skipped deployment step (#57) * Add debug * TO BE REVERTED: Test of deployment * Fix unexpected skipped step due to misscrafted logic * Remove debug lines * Craft the final logic expression and update comments --- .github/workflows/build_and_deploy.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index a4f3aaf..10bd4a2 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -20,6 +20,11 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Debug + run: | + echo "github.event.repository.fork = ${{ github.event.repository.fork }}" + echo "github.event_name = ${{ github.event_name }}" + # Checkout repo AND ITS SUBMODULES - name: 🛒 Checkout uses: actions/checkout@v3 @@ -39,7 +44,7 @@ jobs: path: ./build/blog # Deployment job: heavily inspired from https://swharden.com/blog/2022-03-20-github-actions-hugo/ - # /!\ only triggers on (push events AND non-fork repos) OR manually triggered + # /!\ only triggers on (push events AND NOT fork repos) OR manually triggered ## Required secrets: # - SSH_KNOWN_HOSTS # - PRIVATE_SSH_KEY @@ -55,7 +60,7 @@ jobs: # If for any reason you want to trigger this step on your fork remove the following line, # trigger manually or open an issue https://github.com/iScsc/blog.iscsc.fr/issues, # we'll find a better way to skip this step. - if: ${{ (github.event_name == 'push' && github.event.repository.fork == 'false') || github.event_name == 'workflow_dispatch' }} + if: ${{ (github.event_name == 'push' && ! github.event.repository.fork) || github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest steps: - name: 🛠️ Setup build directory