-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (59 loc) · 2.09 KB
/
dev-to-main-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
50
51
52
53
54
55
56
57
58
59
60
61
62
# Takaro merges feature branches into the development branch first
# and then merges the development branch into the main branch.
# This workflow automates the process of creating a pull request from the development branch to the main branch.
name: Create dev to main PR
on:
push:
branches:
- development
- main
jobs:
mainPromotion:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/development'
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.TAKARO_CI_APP_ID }}
private_key: ${{ secrets.TAKARO_CI_APP_PRIV_KEY }}
- uses: actions/checkout@v4
with:
ref: main
token: ${{ steps.generate_token.outputs.token }}
- name: Reset promotion branch
run: |
git fetch origin development:development
git reset --hard development
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: main-promotion
labels: skip-changelog
token: ${{ steps.generate_token.outputs.token }}
title: 🤖 Merge development into main
body: |
This PR merges the development branch into the main branch.
It is created automatically by the Takaro CI bot.
updateDevelopment:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.TAKARO_CI_APP_ID }}
private_key: ${{ secrets.TAKARO_CI_APP_PRIV_KEY }}
- uses: actions/checkout@v4
with:
ref: development
token: ${{ steps.generate_token.outputs.token }}
- name: Update dev
run: |
git config --global user.name 'takaro-ci-bot[bot]'
git config --global user.email '138661031+takaro-ci-bot[bot]@users.noreply.github.com'
git fetch origin main:main
git rebase main
git push --force-with-lease origin development