Skip to content

Update README.md

Update README.md #6

name: Auto Merge README Changes
on:
pull_request_target:
types: [opened, synchronize, reopened]
paths:
- 'README.md'
permissions:
contents: write
pull-requests: write
issues: write
actions: write
jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if PR only modifies README.md
id: check_files
run: |
base_sha="${{ github.event.pull_request.base.sha }}"
head_sha="${{ github.event.pull_request.head.sha }}"
files_changed=$(git diff --name-only $base_sha $head_sha)
if [ "$files_changed" == "README.md" ]; then
echo "only_readme=true" >> $GITHUB_OUTPUT
else
echo "only_readme=false" >> $GITHUB_OUTPUT
fi
- name: Auto-merge PR
if: steps.check_files.outputs.only_readme == 'true'
run: |
gh pr merge --auto --merge "${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}