From 22659928360e168c15e95bf072055d0eefdc4061 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Mon, 23 Sep 2024 21:53:33 +0200 Subject: [PATCH] actions: prevent workflows triggering twice the workflows running unconditionally for each push and each PR are run twice when pushing to a branch that is to be merged by a PR and if that branch is a branch local to the repo (rather than in a fork). --- .github/workflows/cpplint.yml | 3 +++ .github/workflows/yarnlint.yml | 3 +++ .github/workflows/yarnprettier.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/cpplint.yml b/.github/workflows/cpplint.yml index cdbc7bc1..6ea139df 100644 --- a/.github/workflows/cpplint.yml +++ b/.github/workflows/cpplint.yml @@ -6,6 +6,9 @@ jobs: build: runs-on: ubuntu-latest + # prevent push event from triggering if it's part of a PR + if: github.event_name != 'push' || github.event.pull_request == null + steps: - uses: actions/checkout@v4 - name: Set up Python diff --git a/.github/workflows/yarnlint.yml b/.github/workflows/yarnlint.yml index dd438a05..165235ff 100644 --- a/.github/workflows/yarnlint.yml +++ b/.github/workflows/yarnlint.yml @@ -6,6 +6,9 @@ jobs: build: runs-on: ubuntu-latest + # prevent push event from triggering if it's part of a PR + if: github.event_name != 'push' || github.event.pull_request == null + defaults: run: working-directory: webapp diff --git a/.github/workflows/yarnprettier.yml b/.github/workflows/yarnprettier.yml index c521f88d..d288c8b9 100644 --- a/.github/workflows/yarnprettier.yml +++ b/.github/workflows/yarnprettier.yml @@ -6,6 +6,9 @@ jobs: build: runs-on: ubuntu-latest + # prevent push event from triggering if it's part of a PR + if: github.event_name != 'push' || github.event.pull_request == null + defaults: run: working-directory: webapp