Skip to content

Fix labeler.yml format for actions/labeler@v5 #17

Fix labeler.yml format for actions/labeler@v5

Fix labeler.yml format for actions/labeler@v5 #17

Workflow file for this run

name: Auto Merge Contributor PRs
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: write
pull-requests: write
jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check only Contributors.md was modified
id: check-files
run: |
CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
echo "Changed files: $CHANGED"
if [ "$CHANGED" = "Contributors.md" ]; then
echo "valid=true" >> $GITHUB_OUTPUT
else
echo "valid=false" >> $GITHUB_OUTPUT
echo "PR modifies files other than Contributors.md — skipping auto-merge."
fi
- name: Auto-merge PR
if: steps.check-files.outputs.valid == 'true'
run: gh pr merge --squash "${{ github.event.pull_request.number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}