Merge pull request #1822 from gettakaro/main-promotion #563
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |