forked from eksctl-io/eksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.48 KB
/
release-merge.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Merge release changes to master
on:
push:
branches:
- release-*
env:
VERSION_FILE: pkg/version/release.go
DEFAULT_BRANCH: master
jobs:
merge_release:
name: Merge release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Merge release branch into ${{env.DEFAULT_BRANCH}}
run: |
git checkout $DEFAULT_BRANCH
git checkout -b merge-${{ github.sha }}
git config user.name "weaveworksbot"
git config user.email "[email protected]"
git merge --no-commit --no-ff ${{ github.ref }}
git checkout ORIG_HEAD -- $VERSION_FILE
git add $VERSION_FILE
EDITOR=true git merge --continue
! git diff --exit-code $DEFAULT_BRANCH HEAD
git push --set-upstream origin HEAD
- uses: actions/[email protected]
name: Open PR to ${{env.DEFAULT_BRANCH}}
with:
github-token: ${{ secrets.WEAVEWORKSBOT_TOKEN }}
script: |
const { data: pr } = await github.pulls.create({
...context.repo,
title: `Merge ${context.ref} to ${{ env.DEFAULT_BRANCH }}`,
head: `merge-${context.sha}`,
base: "${{ env.DEFAULT_BRANCH }}",
});
await github.issues.addLabels({
...context.repo,
issue_number: pr.number,
labels: ["skip-release-notes"],
});