Skip to content

Commit bb800da

Browse files
authored
Add auto-merger workflow to periodically merge main into release branch (#1428)
This adds a GitHub Actions workflow which automatically creates a PR to merge the `main` branch into the configured release branch on a set schedule. ### Motivation: This matches a practice a few other Swift repos have done recently, such as Swift package manager in swiftlang/swift-package-manager#9391. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent 98430f2 commit bb800da

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/automerge.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# In the first period after creating a new release branch, we often want to
2+
# continue including all changes from `main` into the release branch. This
3+
# workflow automatically creates a PR to merge main into the release branch on a
4+
# set schedule, and it can also be invoked manually.
5+
#
6+
# Later in the release cycle we generally stop this practice to avoid landing
7+
# risky changes. To disable the workflow when ready, follow the steps described
8+
# in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
9+
10+
name: Create PR to merge main into release branch
11+
12+
permissions:
13+
contents: read
14+
on:
15+
schedule:
16+
- cron: '0 9 * * MON'
17+
workflow_dispatch:
18+
jobs:
19+
create_merge_pr:
20+
name: Create PR to merge main into release branch
21+
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@main
22+
with:
23+
head_branch: main
24+
base_branch: release/6.3
25+
permissions:
26+
contents: write
27+
pull-requests: write
28+
# Ensure that we don't run this on a schedule in a fork
29+
if: (github.event_name == 'schedule' && github.repository == 'swiftlang/swift-testing') || (github.event_name != 'schedule')

0 commit comments

Comments
 (0)