From 28df9d7c9c17b5ac6f38bcfbab67ff4cdeeb455e Mon Sep 17 00:00:00 2001 From: Horst Gutmann Date: Wed, 3 Jul 2024 12:11:27 +0200 Subject: [PATCH 1/2] CI: Run publish-page workflow only on non-forks and docs changes Resolves https://github.com/grafana/tanka/issues/1054 --- .github/workflows/publish-page.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/publish-page.yml b/.github/workflows/publish-page.yml index 554e9e654..952d3ea17 100644 --- a/.github/workflows/publish-page.yml +++ b/.github/workflows/publish-page.yml @@ -5,12 +5,18 @@ on: push: branches: - main + paths: + - "docs/**" + - ".github/workflows/publish-page.yml" pull_request: types: - opened - reopened - synchronize - closed + paths: + - "docs/**" + - ".github/workflows/publish-page.yml" permissions: contents: write @@ -20,6 +26,9 @@ concurrency: ci-${{ github.ref }} jobs: publish: + # Do not run this on forks: + if: github.repository == 'grafana/tanka' + runs-on: ubuntu-22.04 steps: - name: Checkout From 33b50460b51ab4f4512e37280d9f65a1aff78af7 Mon Sep 17 00:00:00 2001 From: Horst Gutmann Date: Wed, 3 Jul 2024 13:19:38 +0200 Subject: [PATCH 2/2] Proper fork detection Co-authored-by: Iain Lane --- .github/workflows/publish-page.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-page.yml b/.github/workflows/publish-page.yml index 952d3ea17..0ee6229d9 100644 --- a/.github/workflows/publish-page.yml +++ b/.github/workflows/publish-page.yml @@ -27,7 +27,7 @@ concurrency: ci-${{ github.ref }} jobs: publish: # Do not run this on forks: - if: github.repository == 'grafana/tanka' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'grafana/tanka' runs-on: ubuntu-22.04 steps: