From f3635ff50d90ca2fbf87271dc3146f2aacdb6b3c Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 30 Apr 2023 14:03:29 -0400 Subject: avoid re-uploading the docs when a PR is based on the upstream repo In this case, we have the secret available, and the workflow ran even though it wasn't on branch "master" because of the pull request trigger. Since the change hasn't landed on master, though, we do not want to update the website. So check for pushes to master, specifically. --- .github/workflows/website.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 3b1d517..fa322fb 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -41,7 +41,7 @@ jobs: run: | ssh-agent -a $SSH_AUTH_SOCK > /dev/null ssh-add - <<< "${{ secrets.WEBSITE_PRIV_KEY }}" - if: env.HAS_SSH_KEY == 'true' + if: github.ref == 'refs/heads/master' && env.HAS_SSH_KEY == 'true' - name: Build website run: | git config --global user.name "github-actions" @@ -56,7 +56,7 @@ jobs: run: | cd docs ninja -C _build upload - if: env.HAS_SSH_KEY == 'true' + if: github.ref == 'refs/heads/master' && env.HAS_SSH_KEY == 'true' - name: Release the current JSON docs uses: svenstaro/upload-release-action@v2 with: @@ -71,4 +71,3 @@ jobs: file: docs/_build/meson-reference.3 tag: ${{ github.ref }} if: ${{ github.event_name == 'release' }} - -- cgit v1.1