From b39c5f5fb6c4779b0ec63ee8f6df9703b82ace2e Mon Sep 17 00:00:00 2001 From: Javier <10879637+javiertuya@users.noreply.github.com> Date: Mon, 20 Jul 2026 08:25:39 +0200 Subject: [PATCH] ci: avoid duplicate workflow run on pull requests from the local repo --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a2c103a..7315647 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,8 @@ on: jobs: test-java: runs-on: ubuntu-latest + #avoids duplicate execution of pr from local repo, but allows pr from forked repos and dependabot + if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/'))) defaults: run: working-directory: java @@ -48,6 +50,8 @@ jobs: java/target/tmp*/*.html test-net: runs-on: ubuntu-latest + #avoids duplicate execution of pr from local repo, but allows pr from forked repos and dependabot + if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/'))) defaults: run: working-directory: net