Skip to content

Backport

Backport #914

# 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