Merge Elastic updates #191
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: actions/create-github-app-token@v1 | |
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@v7 | |
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 }}' | |
}) |