From ead8b5fa3f965bff23e4e223c1b953e0544a2fee Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Mon, 22 Jul 2024 19:59:16 -0400 Subject: [PATCH] only run each job once when triggered by a PR's push --- .github/workflows/automations.yml | 6 ++++-- .github/workflows/build-dev.yml | 2 ++ .github/workflows/roku-analysis.yml | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automations.yml b/.github/workflows/automations.yml index a29a73f4d..3f167cb54 100644 --- a/.github/workflows/automations.yml +++ b/.github/workflows/automations.yml @@ -10,7 +10,8 @@ on: jobs: project: - if: github.repository == 'jellyfin/jellyfin-roku' + # don't run job on forks and prevent job from running twice when a PR pushes a new commit + if: github.repository == 'jellyfin/jellyfin-roku' && github.event_name != 'pull_request' || github.repository == 'jellyfin/jellyfin-roku' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Project board 📊 runs-on: ubuntu-latest steps: @@ -22,7 +23,8 @@ jobs: column: In progress repo-token: ${{ secrets.JF_BOT_TOKEN }} label: - if: github.repository == 'jellyfin/jellyfin-roku' + # don't run job on forks and prevent job from running twice when a PR pushes a new commit + if: github.repository == 'jellyfin/jellyfin-roku' && github.event_name != 'pull_request' || github.repository == 'jellyfin/jellyfin-roku' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Labeling 🏷️ runs-on: ubuntu-latest steps: diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 7dd170e12..723522b6d 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -6,6 +6,8 @@ on: jobs: dev: + # prevent job from running twice when a PR pushes a new commit + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 diff --git a/.github/workflows/roku-analysis.yml b/.github/workflows/roku-analysis.yml index 2bac16036..0d39269db 100644 --- a/.github/workflows/roku-analysis.yml +++ b/.github/workflows/roku-analysis.yml @@ -9,6 +9,8 @@ env: jobs: static: + # don't run job on forks and prevent job from running twice when a PR pushes a new commit + if: github.repository == 'jellyfin/jellyfin-roku' && github.event_name != 'pull_request' || github.repository == 'jellyfin/jellyfin-roku' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4