diff --git a/.github/workflows/cherry-pick-electron-bumps.yml b/.github/workflows/cherry-pick-electron-bumps.yml new file mode 100644 index 00000000000..a7a37c07069 --- /dev/null +++ b/.github/workflows/cherry-pick-electron-bumps.yml @@ -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}} diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml deleted file mode 100644 index 2764733c0b5..00000000000 --- a/.github/workflows/dependabot-auto-merge.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Dependabot auto-merge -on: pull_request_target - -permissions: - pull-requests: write - contents: write - -jobs: - activate-auto-merge: - runs-on: ubuntu-latest - if: ${{github.actor == 'dependabot[bot]'}} - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v2.3.0 - with: - github-token: '${{secrets.WEBTEAM_AUTOMERGE_TOKEN}}' - - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.WEBTEAM_AUTOMERGE_TOKEN}} - - - name: Enable auto-merge for Dependabot PRs - if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}} - run: gh pr merge --auto --squash "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.WEBTEAM_AUTOMERGE_TOKEN}} diff --git a/.github/workflows/pr-auto-merge.yml b/.github/workflows/pr-auto-merge.yml new file mode 100644 index 00000000000..b536701db89 --- /dev/null +++ b/.github/workflows/pr-auto-merge.yml @@ -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}}