From efc8e3db53603f9cef113f03b621fe8582f4249e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Mon, 30 Sep 2024 14:06:04 +0200 Subject: [PATCH] Better fork detection in GitHub Actions --- .github/workflows/ci-integration-tests.yml | 4 ++-- .github/workflows/weblate-merge-po.yml | 2 +- .github/workflows/weblate-merge-products-po.yml | 2 +- .github/workflows/weblate-merge-service-po.yml | 2 +- .github/workflows/weblate-update-pot.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-integration-tests.yml b/.github/workflows/ci-integration-tests.yml index 990d52c049..722c67c7e6 100644 --- a/.github/workflows/ci-integration-tests.yml +++ b/.github/workflows/ci-integration-tests.yml @@ -13,7 +13,7 @@ jobs: timeout-minutes: 60 runs-on: ubuntu-latest # do not run scheduled jobs in forks, in forks only allow manual run ("workflow_dispatch") - if: github.repository_owner == 'openSUSE' || github.event_name == 'workflow_dispatch' + if: (!github.event.repository.fork) || github.event_name == 'workflow_dispatch' steps: @@ -101,7 +101,7 @@ jobs: # see https://github.com/marketplace/actions/irc-message-action uses: Gottox/irc-message-action@v2 # never run in forks or when triggered manually - if: failure() && github.repository_owner == 'openSUSE' && github.event_name != 'workflow_dispatch' + if: failure() && !github.event.repository.fork && github.event_name != 'workflow_dispatch' with: channel: "#yast" nickname: github-action diff --git a/.github/workflows/weblate-merge-po.yml b/.github/workflows/weblate-merge-po.yml index 1f5a0f85cb..5d500a9752 100644 --- a/.github/workflows/weblate-merge-po.yml +++ b/.github/workflows/weblate-merge-po.yml @@ -16,7 +16,7 @@ jobs: pull-requests: write # do not run in forks - if: github.repository == 'openSUSE/agama' + if: !github.event.repository.fork runs-on: ubuntu-latest diff --git a/.github/workflows/weblate-merge-products-po.yml b/.github/workflows/weblate-merge-products-po.yml index cbf706b36c..93bc9c6a1e 100644 --- a/.github/workflows/weblate-merge-products-po.yml +++ b/.github/workflows/weblate-merge-products-po.yml @@ -16,7 +16,7 @@ jobs: pull-requests: write # do not run in forks - if: github.repository == 'openSUSE/agama' + if: !github.event.repository.fork runs-on: ubuntu-latest diff --git a/.github/workflows/weblate-merge-service-po.yml b/.github/workflows/weblate-merge-service-po.yml index 9639476090..37b88ba090 100644 --- a/.github/workflows/weblate-merge-service-po.yml +++ b/.github/workflows/weblate-merge-service-po.yml @@ -16,7 +16,7 @@ jobs: pull-requests: write # do not run in forks - if: github.repository_owner == 'openSUSE' + if: !github.event.repository.fork runs-on: ubuntu-latest diff --git a/.github/workflows/weblate-update-pot.yml b/.github/workflows/weblate-update-pot.yml index 462f64b2fb..300c526121 100644 --- a/.github/workflows/weblate-update-pot.yml +++ b/.github/workflows/weblate-update-pot.yml @@ -11,7 +11,7 @@ on: jobs: update-pot: # do not run in forks - if: github.repository == 'openSUSE/agama' + if: !github.event.repository.fork runs-on: ubuntu-latest