Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/auto_approve_api_ref_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Approve and merge API reference sync PRs

# Automatically approve and merge API reference sync PRs from Haystack, Haystack Core Integrations,
# and Haystack Experimental

on:
pull_request:
branches:
- main
paths:
- "docs-website/reference/**"
- "docs-website/reference_versioned_docs/**"

permissions:
pull-requests: write
contents: write

env:
GH_TOKEN: ${{ github.token }}

jobs:
auto-approve-and-merge:
if: |
github.event.pull_request.user.login == 'HaystackBot' &&
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. HaystackBot is important here to prevent malicious users from creating PRs that get auto-merged.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.event.pull_request.head.repo.full_name == github.repository could be added to prevent forks from triggering this job but HaystackBot doesn't use forks anyway.
No change request.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added it to be extra-safe

startsWith(github.event.pull_request.head.ref, 'sync-docusaurus-api-reference') &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-slim
steps:
- name: Approve PR
run: gh pr review --approve ${{ github.event.pull_request.number }} --repo ${{ github.repository }}

- name: Enable auto-merge
run: gh pr merge --squash --auto ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
Loading