With on: [push, pull_request], every push to a pull request's branch starts two runs of the same tests: one for the push, one for the pull request. gh run list shows both, with EVENT push and pull_request.
branches: limits a trigger. Run on pushes to main, and on pull requests into main:
on:
push:
branches: [main]
pull_request:
branches: [main]For push, branches: is the branch pushed to. For pull_request, it's the branch it merges into.
A branch's workflow decides its runs, so change it on main first: commit, git push. Then a branch made from main gets it too:
git switch -c add-ogreObjectives
- Run on pushes to main only.
- One run per pull request push.