Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Backport

Backport #971

# This automated work flow is responsible for backporting changes from the beta
# branch to the alpha branch.
name: Backport
on:
workflow_dispatch:
schedule:
# You can setup schedule here
- cron: '0 0 * * *'
jobs:
stable:
runs-on: ubuntu-latest
if: always()
env:
# replace "github_username" with your GitHub username
# replace "github.com/username/repo.git" with your GitHub repo path
# do NOT replace ${{secrets.GITHUB_TOKEN}}, GitHub will take care of it
MY_REPO: https://fushra-bot:${{secrets.GITHUB_TOKEN}}@github.com/pulse-browser/browser.git
# replace "long-lived_branch_name" with your branch name
MY_BRANCH: beta
# replace it with the path to master repo
MASTER_REPO: https://github.com/pulse-browser/browser.git
# replace "master" with your master branch name
MASTER_BRANCH: stable
steps:
- name: Merge with master
run: |
git clone ${{env.MY_REPO}} -b ${{env.MY_BRANCH}} tmp
cd tmp
git config user.name "Fushra Bot"
git config user.email "[email protected]"
git config pull.rebase true
git pull ${{env.MASTER_REPO}} ${{env.MASTER_BRANCH}}
git pull ${{env.MASTER_REPO}} ${{env.MY_BRANCH}}
git commit --amend -m "πŸ”€ Backport changes from ${{env.MASTER_BRANCH}} to ${{env.MY_BRANCH}}"
git push
beta:
runs-on: ubuntu-latest
needs: [stable]
if: always()
env:
# replace "github_username" with your GitHub username
# replace "github.com/username/repo.git" with your GitHub repo path
# do NOT replace ${{secrets.GITHUB_TOKEN}}, GitHub will take care of it
MY_REPO: https://fushra-bot:${{secrets.GITHUB_TOKEN}}@github.com/pulse-browser/browser.git
# replace "long-lived_branch_name" with your branch name
MY_BRANCH: alpha
# replace it with the path to master repo
MASTER_REPO: https://github.com/pulse-browser/browser.git
# replace "master" with your master branch name
MASTER_BRANCH: beta
steps:
- name: Merge with master
run: |
git clone ${{env.MY_REPO}} -b ${{env.MY_BRANCH}} tmp
cd tmp
git config user.name "Fushra Bot"
git config user.email "[email protected]"
git config pull.rebase true
git pull ${{env.MASTER_REPO}} ${{env.MASTER_BRANCH}}
git pull ${{env.MASTER_REPO}} ${{env.MY_BRANCH}}
git commit --amend -m "πŸ”€ Backport changes from ${{env.MASTER_BRANCH}} to ${{env.MY_BRANCH}}"
git push