Skip to content

Commit

Permalink
ci: merge electron bumps to staging and main [WPB-15058] (#8502)
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Gira authored Jan 27, 2025
1 parent e8e639a commit f9ae2db
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 30 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/cherry-pick-electron-bumps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This job will automatically create a cherry-pick PR for any update to the electron version on the dev branch.
# It allows the staging and main branch to stay up-to-date with dependabot electron bumps on dev.
name: Cherry-pick Electron bumps

on:
push:
branches:
- 'dev'

permissions:
pull-requests: write
contents: write

jobs:
cherry_pick:
env:
PR_TITLE: $
if: ${{ github.event.pull_request.title }} == '*bump electron from*'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create PR to staging
uses: gorillio/github-action-cherry-pick@master
with:
pr_branch: 'staging'
env:
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}

- name: Create PR to main
uses: gorillio/github-action-cherry-pick@master
with:
pr_branch: 'main'
env:
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
30 changes: 0 additions & 30 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/pr-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: auto-merge PR
on: pull_request

permissions:
pull-requests: write
contents: write

# This job will enable auto merge on dependabots and otto-the-bot's PRs
jobs:
activate-auto-merge:
runs-on: ubuntu-latest
if: ${{github.actor == 'dependabot[bot]' || github.actor == 'otto-the-bot'}}
steps:
- name: Approve PR
run: gh pr review --approve "$PR_URL"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{github.event.pull_request.html_url}}

- name: Enable auto-merge
run: gh pr merge --auto --squash "$PR_URL"
env:
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
PR_URL: ${{github.event.pull_request.html_url}}

0 comments on commit f9ae2db

Please sign in to comment.