-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (42 loc) · 1.35 KB
/
merge_bugfix.yml
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
---
name: Merge bugfix into feature branch
on:
push:
branches:
- bugfix
jobs:
merge_bugfix:
name: Merge bugfix into feature branch
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[Bot]')"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: feature
- name: Reset bugfix branch
run: |
export FEATURE_VERSION="$(cat .version)"
git fetch origin bugfix:bugfix
git reset --hard bugfix
echo -n "${FEATURE_VERSION}" > .version
- name: Generate token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.TOKEN_APP_ID }}
private-key: ${{ secrets.TOKEN_APP_SECRET }}
- name: Submit pull request
id: pull-request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: '[Bot] Merge bugfix into feature branch.'
branch: merge-bugfix
title: Merge bugfix into feature branch
labels: bot
body: Merge branch "bugfix" into "feature".
- name: Enable auto-merge
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh pr merge --merge --auto "${{ steps.pull-request.outputs.pull-request-number }}"