Skip to content

GitHub Actions has overlapping triggers which causes tests to run twice when pushing to an open PR #1370

@AzfaarQureshi

Description

@AzfaarQureshi

What is the issue
There are overlapping triggers for the test workflow which causes it to run twice if you commit to an open PR

Why is this a problem
Well, it's not that deep of a problem but:

  • you have to wait longer for CI to resolve
  • uses up twice the GitHub Actions minutes
  • slows down all other workflows as the 21 redundant runners increase queue times

it's more of a mild inconvenience but the fix is super quick (I can make a PR if the change is green-lit 😄)

We can solve this by only allowing pushes on master to trigger the workflow

# test.yml
name: Test
on:
  push:
   # branches-ignore:
   # - 'release/*'
    branches: master # proposed addition
  pull_request:

Steps to reproduce

  1. Open a PR
    • GitHub Actions test workflow only runs once under the pull_request trigger (expected behavior)
    • 21 total checks
  2. Push a commit to the open PR
    • test workflow runs twice, once under pull_request (expected) and again under push (unexpected)
    • 42 total checks
      Screen Shot 2020-11-09 at 8 30 35 PM
      Screen Shot 2020-11-09 at 8 46 07 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions