[Bot] rebase suite-e branch on develop #54
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
name: "[Bot] rebase suite-e branch on develop" | |
on: | |
schedule: | |
- cron: "30 13 * * *" # for testing | |
jobs: | |
rebase: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Configure git | |
run: | | |
git config --global user.name "trezor-ci" | |
git config --global user.email "${{ secrets.TREZOR_BOT_EMAIL }}" | |
- name: Rebase the suite-e branch on develop | |
id: rebase | |
run: | | |
echo 'Checking out suite-e branch' | |
git checkout suite-e | |
echo 'Rebasing suite-e to develop' | |
git rebase develop | |
if git status --porcelain | grep -q "^UU"; then | |
echo "Rebase conflicts detected" | |
echo "STATUS=conflicts" >> $GITHUB_OUTPUT | |
else | |
echo 'Rebase successful' | |
fi | |
- name: Push the rebased suite-e branch | |
if: steps.rebase.outputs.STATUS != 'conflicts' && steps.rebase.outputs.STATUS != 'error' | |
run: | | |
echo 'Pushing suite-e branch' | |
git push --force-with-lease | |
- name: Notify Slack | |
if: steps.rebase.outputs.status == 'conflicts' | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
status: ${{steps.rebase.outputs.status}}, | |
run_url: 'https://github.com/trezor/trezor-suite/actions/runs/${{ github.run_id }}', | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SUITE_E_WEBHOOK_URL }} |