github/branch-deploy

Why do pull requests need to be subset of push?

dyastremsky opened this issue · 1 comments

Details

In https://github.com/github/branch-deploy/blob/main/.github/workflows/codeql-analysis.yml#L8, the code with comments is:

push:
    branches: [ main ]
  # Disable on PR for now to speed up testing
  # pull_request:
  #   # The branches below must be a subset of the branches above
  #   branches: [ main ]

Why do the pull requests branches have to be a subset of push branches? From testing, it appears that they don't need to be. Moreover, it appears that the any workflow (including CodeQL) runs twice if the branch name matches both those in push and pull request.

@dyastremsky that was just the way my editor commented out the code which is deceiving.

See here for a working example with proper formatting.