From 53600909d2053ed9a18f424299e58766e62c7e96 Mon Sep 17 00:00:00 2001 From: William Black Date: Tue, 11 Jul 2023 20:20:33 -0700 Subject: [PATCH] Require build-docs label only when making a pull request to upstream/main --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index ed63811d..e8979dec 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -12,7 +12,7 @@ defaults: shell: bash -le {0} jobs: build-sphinx-html: - if: (((github.repository == 'tardis-sn/stardis') && (${{ github.head_ref || github.ref_name}} == 'main')) || (github.repository_owner != 'tardis-sn')) && contains(github.event.pull_request.labels.*.name, 'build-docs') + if: ((github.repository == 'tardis-sn/stardis') && (${{ github.head_ref || github.ref_name}} == 'main') && contains(github.event.pull_request.labels.*.name, 'build-docs')) || (github.repository_owner != 'tardis-sn') # The above line makes this action run if it is either not on the upstream/main or the main branch of upstream/main. # If there is a better way to implement this, I'd like someone to please share. # The context to get the branch name is from https://stackoverflow.com/a/71158878