You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Merges `head_branch` into `base_branch` and opens a PR to incorporate that merge commit into `base_branch`.
4
+
#
5
+
# The typical use case for this is in the first period after Swift has cut release branches.
6
+
# Some repositories want to include most changes from `main` also in the release branch. When this job is set up, it can automatically create PRs to merge `main` into the release branch.
7
+
# Maintainers of the package can then inspect the changes to ensure that they are not too risky for the release branch.
8
+
# We will also run the normal PR testing on these changes, ensuring that these modifications don't break the build.
9
+
#
10
+
# Example usage in a repository:
11
+
#
12
+
# name: Create PR to merge main into release branch
13
+
#
14
+
# # In the first period after branching the release branch, we typically want to include all changes from `main` also in the release branch. This workflow automatically creates a PR every Monday to merge main into the release branch.
15
+
# # Later in the release cycle we should stop this practice to avoid landing risky changes by disabling this workflow. To do so, disable the workflow as described in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
16
+
#
17
+
# on:
18
+
# schedule:
19
+
# - cron: '0 9 * * MON'
20
+
# workflow_dispatch:
21
+
#
22
+
# jobs:
23
+
# create_merge_pr:
24
+
# name: Create PR to merge main into release branch
# if: (github.event_name == 'schedule' && github.repository == 'swiftlang/swift-format') || (github.event_name != 'schedule') # Ensure that we don't run this on a schedule in a fork
27
+
# with:
28
+
# base_branch: release/6.2
29
+
30
+
on:
31
+
workflow_call:
32
+
inputs:
33
+
base_branch:
34
+
type: string
35
+
description: The branch into which head_branch should be merged
36
+
required: true
37
+
head_branch:
38
+
type: string
39
+
description: The branch that should be merged into base_branch
40
+
default: main
41
+
pr_message:
42
+
type: string
43
+
description: The message that should be included in the PR created by this job
44
+
default: This PR was automatically opened by a GitHub action. Review the changes included in this PR and determine if they should be included in the release branch. If yes, merge the PR. Otherwise revert changes that should not be included on this branch.
45
+
46
+
jobs:
47
+
create_merge_pr:
48
+
name: Create PR to merge ${{ inputs.head_branch }} into ${{ inputs.base_branch }} branch
49
+
runs-on: ubuntu-latest
50
+
steps:
51
+
- name: Checkout repository
52
+
uses: actions/checkout@v4
53
+
with:
54
+
fetch-depth: 0
55
+
- name: Create merge commit
56
+
id: create_merge_commit
57
+
run: |
58
+
# Without this, we can't perform git operations in GitHub actions.
0 commit comments