-
Notifications
You must be signed in to change notification settings - Fork 24
47 lines (40 loc) · 1.39 KB
/
auto-approve-merge.yml
File metadata and controls
47 lines (40 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# SPDX-FileCopyrightText: 2025 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
name: Auto Approve & Merge
on:
pull_request:
types: [opened, synchronize, reopened]
permissions: {}
jobs:
auto-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Auto approve PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.actor == github.actor == 'sys-orch' &&
github.event.pull_request.base.ref == 'main-pass-validation'
run: |
echo "Approving PR #${{ github.event.pull_request.number }} by ${{ github.actor }}"
gh pr review ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --approve --body "Auto approved by sys-orch-github-approve bot"
auto-merge:
permissions:
pull-requests: write
contents: write
name: Auto merge PR
needs:
- auto-approve
runs-on: ubuntu-latest
if: |
github.actor == 'sys-orch' &&
github.event.pull_request.base.ref == 'main-pass-validation'
steps:
- name: Auto merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Enabling auto-merge for PR #${{ github.event.pull_request.number }} by ${{ github.actor }}"
gh pr merge ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --auto --squash