From 7a8fa4b42753792376c4915128f3e211a8225d5d Mon Sep 17 00:00:00 2001 From: Gabriel Le Breton Date: Mon, 19 Oct 2020 12:46:48 -0400 Subject: [PATCH] Trigger builds on main branch push This is tricky. I wish we could trigger on all branches push, but it seems like internal PRs are run twice when using this: ```yaml on: pull_request: {} push: {} ``` So specifying a branch is a bit better somehow. Related discussions: * https://github.community/t/how-to-run-a-workflow-only-once-even-when-triggered-mutliple-times/16436 * https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41c7eb6..b393930 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Unity Actions on: pull_request: {} - push: {} + push: { branches: [main] } env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}