-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (36 loc) · 1.27 KB
/
auto-merge-release-update.yml
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
48
name: "Create Pull Request and Enable Auto Merge"
on:
push:
branches:
- 'releases/**'
pull_request:
branches:
- 'master'
# Increase the access for the GH_TOKEN
permissions:
# This Allows the GITHUB_TOKEN to approve pull requests
pull-requests: write
# This Allows the GH_TOKEN to auto merge pull requests
contents: write
jobs:
create-pr-for-update:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.actor == 'team-integrations-fnm-bot' }}
env:
GH_TOKEN: ${{secrets.INTEGRATIONS_FNM_BOT_TOKEN}}
steps:
- uses: actions/checkout@v3
- name: Create release update PR
run: gh pr create --title "Publish new CLI release to homebrew" --body "This is an automated PR, it should be auto-merged if checks are green."
pr-enable-auto-merge:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.actor == 'team-integrations-fnm-bot' }}
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{github.event.pull_request.html_url}}
steps:
- uses: actions/checkout@v3
- name: Approve release update PR
run: gh pr review --approve "$PR_URL"
- name: Enable auto-merge for release update PR"
run: gh pr merge --auto --squash "$PR_URL"