-
Notifications
You must be signed in to change notification settings - Fork 6.7k
42 lines (36 loc) · 1.13 KB
/
update-merge.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
name: Merge Elastic updates
on:
workflow_run:
workflows: [ CI ]
types:
- completed
branches:
- update/main
- update/tls
- update/release-7.x
jobs:
merge:
name: Merge pull request
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Impersonate update bot
uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Approve and merge
uses: ridedott/merge-me-action@v2
with:
GITHUB_LOGIN: docker-elk-updater
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
- name: Delete branch
uses: actions/github-script@v6
with:
script: |
await github.request('DELETE /repos/{owner}/{repo}/git/refs/{ref}', {
owner: '${{ github.event.workflow_run.repository.owner.login }}',
repo: '${{ github.event.workflow_run.repository.name }}',
ref: 'heads/${{ github.event.workflow_run.head_branch }}'
})