-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (45 loc) · 1.48 KB
/
auto-release-pr.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
43
44
45
46
47
48
49
name: Auto release PR
on:
push:
branches:
- main
- staging
permissions:
contents: write # to create release
pull-requests: write # to create release PR
jobs:
# from https://github.com/peter-evans/create-pull-request/blob/main/docs/examples.md#keep-a-branch-up-to-date-with-another
productionRelease:
if: github.ref == 'refs/heads/staging'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: production
- name: Create PR from staging to production
run: |
git fetch origin main:main
git reset --hard main
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
branch: production-release
title: 'chore: Merge staging into production'
body: 'This PR merges commits from staging into production.'
stagingRelease:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: staging
- name: Create PR from main to staging
run: |
git fetch origin main:main
git reset --hard main
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
branch: staging-release
title: 'chore: Merge main into staging'
body: 'This PR merges commits from main into staging.'