Skip to content

ci/backport: init #3411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged

ci/backport: init #3411

merged 1 commit into from
May 30, 2025

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented May 30, 2025

Adds a GitHub workflow to create backport PRs when merged PRs have a "backport" label.

This uses the very flexible https://github.com/korthout/backport-action and is based on the workflow used by nixpkgs, which is also used by Stylix. See how it works.

Currently, the workflow will assume our backport labels follow the regex backport ([^ ]+)$ (e.g. backport nixos-25.05), however we could customise that by assigning any regex we like to with: label_pattern.

Mergify also has backport support, which we've used a few times via the @mergifyio backport command. While we could configure our mergify.yml file to look for "backport" labels, IMO it is better to use a GitHub-based solution so that we are not locked into continuing with Mergify indefinitely.

This also has the purely aesthetic1 advantage that it'll show as backported by nixvim-ci[bot] 🤩

Footnotes

  1. ok, it's not purely aesthetic. This causes github workflows to be triggered by events caused by the bot. If we used github-actions[bot] then no workflow events would trigger. The peter-evans/create-pull-request docs explain this best.

Adds a GitHub workflow to create backport PRs when merged PRs have a
"backport" label.

Based on the workflow used by nixpkgs:
https://github.com/NixOS/nixpkgs/blob/2566f9dc/.github/workflows/backport.yml
@MattSturgeon MattSturgeon requested review from khaneliman and a team May 30, 2025 00:36
@MattSturgeon MattSturgeon added the CI/CD Related to CI or CD, i.e. GitHub Actions or Buildbot label May 30, 2025
Copy link
Member

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@khaneliman khaneliman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh I need to do this in HM :P

@MattSturgeon

This comment was marked as resolved.

This comment was marked as resolved.

Copy link
Contributor

mergify bot commented May 30, 2025

This pull request, with head sha 8b3a69cfea5ba2fa008c6c57ab79c99c513a349b, has been successfully merged with fast-forward by Mergify.

This pull request will be automatically closed by GitHub.

As soon as GitHub detects that the sha 8b3a69cfea5ba2fa008c6c57ab79c99c513a349b is part of the main branch, it will mark this pull request as merged.

It is possible for this pull request to remain open if this detection does not happen, this usually happens when a force-push is done on this branch ci/backport, this means GitHub will fail to detect the merge.

@mergify mergify bot merged commit 8b3a69c into nix-community:main May 30, 2025
4 checks passed
@mergify mergify bot temporarily deployed to github-pages May 30, 2025 19:55 Inactive
@MattSturgeon MattSturgeon deleted the ci/backport branch May 30, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Related to CI or CD, i.e. GitHub Actions or Buildbot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants