Skip to content

Build pushes on master only; pull requests build every change - #32

Merged
imranakram merged 1 commit into
masterfrom
ci/build-pushes-on-master-only
Oct 9, 2026
Merged

imranakram merged 1 commit into
masterfrom
ci/build-pushes-on-master-only

Conversation

@imranakram

Copy link
Copy Markdown
Collaborator

Each push to a branch with an open pull request started two identical CI builds: one for the push, one for the pull request.

The cause

build.yml triggered on push to every branch ('**') and on pull_request to master. A push to a branch with an open pull request matches both.

Both runs build Release and Debug, run all tests and pack the NuGet packages. Each run also counts towards the version, 1.<year>.<month>.<builds this month>, so the duplicates used up version numbers as well.

The change

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  workflow_dispatch:
  • Pushes to master still build. The Release workflow publishes from those runs, so nothing changes there.
  • Every change on its way to master is built by its pull request, against the merge result, which is the more useful build of the two.
  • workflow_dispatch builds any branch by hand from the Actions tab, for a branch without a pull request.

Only the trigger section of build.yml changes. The build steps and the version calculation are untouched.

The CI build ran on every push to any branch and on every pull request to
master, so each push to a branch with an open pull request built the same
code twice. Each run also counts towards the version number, which is the
number of builds this month, so the duplicates used up version numbers.

Pushes now build only on master, where the Release workflow takes its
packages from. A change on its way to master is built by its pull request,
against the merge result. workflow_dispatch builds any branch by hand.
@imranakram
imranakram merged commit faa1c8e into master Oct 9, 2026
1 check passed
@imranakram
imranakram deleted the ci/build-pushes-on-master-only branch October 9, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant