Skip to content

Update README.md

Update README.md #1

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@v2
- name: Check if PR only modifies README.md
id: check_files
run: |
files_changed=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
if [ "$files_changed" == "README.md" ]; then
echo "::set-output name=only_readme::true"
else
echo "::set-output name=only_readme::false"
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 }}