Skip to main content

Squash task pull requests into one commit

By default a task's pull request merges with a merge commit, so every commit the runner made shows in the integration branch's history. Turn on Squash task PRs when you want one commit per task instead. The commit is named after the task, such as Add a CSV export (Task 412), so the history reads as a list of finished tasks.

The setting covers the whole project, every repository in it. It changes only pull requests that tasks open. Pull requests from bots, from people and from releases keep their merge commits.

Who can do this: anyone who can edit the project opens its settings. Changing the Branches section also requires the org owner role, or the org admin role with permission to edit nodes. Without it the section is locked. The setting shows only on a project with a repository, once the project exists.

Before you start: the repository must allow squash merging. On GitHub, for example, that is Allow squash merging in the repository's own settings. If it is off, your forge refuses the squash merge.

  1. In the sidebar, select Directory, then the Projects tab, and select the project's name. Its settings open on General.
  2. Select Branches in the list of sections on the left. If the list is long, type squash in Search settings and pick Squash task PRs from the results instead.
  3. Below the branch policy, tick Squash task PRs. Hover its label to read Task PRs merge as one commit named after the task.
  4. Select Save under the section. Save and Discard appear only once you change something.
  5. Check the list of sections: it shows On beside Branches, because one of its settings is off its default.
  6. After the next task merges, open the integration branch's history on your forge. The task's work is one commit, named after the task with its number.

To go back to merge commits, untick Squash task PRs and select Save. Pull requests already merged keep the commits they were merged with.

The setting works the same whether a task merges on its own or through the merge lane. With the merge lane, each task in a batch still lands as its own commit.