Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,25 @@ 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
uses: dev-hanz-ops/install-gh-cli-action@af38ce09b1ec248aeb08eea2b16bbecea9e059f8 # v0.2.1
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 }}
- 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 }}
Loading