Skip to content

Auto-merge trusted contributors #26

Auto-merge trusted contributors

Auto-merge trusted contributors #26

Workflow file for this run

name: Auto-merge trusted contributors
on:
workflow_run:
workflows: ["Lint and Test Charts"]
types: [completed]
permissions:
contents: write
pull-requests: write
jobs:
auto-merge:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request' &&
contains(fromJSON('["makavity", "mit-73"]'), github.event.workflow_run.actor.login)
steps:
- name: Enable auto-merge
run: |
PR_NUMBER="${{ github.event.workflow_run.pull_requests[0].number }}"
if [ -z "$PR_NUMBER" ] || [ "$PR_NUMBER" = "0" ]; then
echo "No PR found in workflow_run payload, skipping"
exit 0
fi
gh pr merge --auto --squash "$PR_NUMBER" --repo "${{ github.repository }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}