-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.4 KB
/
auto-merge-openapi-updates.yml
File metadata and controls
42 lines (40 loc) · 1.4 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
name: Auto-merge OpenAPI updates
on:
pull_request:
types: [opened, synchronize, closed]
jobs:
auto-merge:
if: |
github.event_name == 'pull_request' &&
startsWith(github.head_ref, 'auto/update-openapi') &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login == '0x-automation[bot]'
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Enable auto-merge
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log merge status
run: |
echo "✅ Auto-merge enabled for PR: ${{ github.event.pull_request.html_url }}"
publish-after-merge:
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.merged == true &&
startsWith(github.head_ref, 'auto/update-openapi') &&
github.event.pull_request.user.login == '0x-automation[bot]'
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Trigger publish-docs workflow
run: |
gh workflow run publish-docs.yml --ref main
echo "✅ Triggered publish-docs workflow after merge of PR: ${{ github.event.pull_request.html_url }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}