diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 34c5361..7d36fc4 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -26,12 +26,13 @@ jobs: for file in ${{ steps.files.outputs.all_changed_files }}; do if [[ ! "$file" =~ \.md$ ]]; then - echo "Non-markdown file detected: $file" + echo "Non-markdown file detected: $file. PR WILL NOT BE MERGED" echo "only_markdown=false" >> $GITHUB_OUTPUT exit 0 fi done - + + echo "All changed files are markdown files. PR WILL BE MERGED" echo "only_markdown=true" >> $GITHUB_OUTPUT - name: Install GH CLI @@ -39,11 +40,11 @@ jobs: with: gh-cli-version: 2.49.2 -# - name: Enable auto-merge -# if: steps.check.outputs.only_markdown == 'true' -# run: | -# gh pr merge ${{ github.event.pull_request.number }} \ -# --auto \ -# --merge -# env: -# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Enable auto-merge + if: steps.check.outputs.only_markdown == 'true' + run: | + gh pr merge ${{ github.event.pull_request.number }} \ + --auto \ + --merge + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}