Skip to content

Commit

Permalink
ci: merge electron bumps to staging and main [WPB-15058] (#8533)
Browse files Browse the repository at this point in the history
* ci: merge electron bumps to staging and main [WPB-15058] (#8502)

* runfix: move condition to create PR stage and base condition on commit name

* Update .github/workflows/cherry-pick-electron-bumps.yml
  • Loading branch information
V-Gira authored Jan 31, 2025
1 parent 6c975a8 commit 21b11d9
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 30 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/cherry-pick-electron-bumps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create PR to staging
if: contains(github.event.head_commit.message, 'bump electron from')
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
if: contains(github.event.head_commit.message, 'bump electron from')
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 21b11d9

Please sign in to comment.