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
36 changes: 33 additions & 3 deletions .github/workflows/merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,45 @@ on:
- main
types:
- opened
- labeled
- unlabeled
- synchronize

jobs:
pr-message:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
submodules: false

- name: Filter paths
id: filter
run: |
MERGE_BASE=$(git merge-base origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF})
FILES=$(git diff --name-only $MERGE_BASE origin/${GITHUB_HEAD_REF})
IGNORE=true
for FILE in $FILES; do
if [[ $FILE != plugins/* && $FILE != .github/* ]]; then
IGNORE=false
break
fi
done

if $IGNORE; then
echo "ignore=true" >> $GITHUB_OUTPUT
echo "Filter result code: ignore = true"
else
echo "ignore=false" >> $GITHUB_OUTPUT
echo "Filter result code: ignore = false"
fi
shell: bash

- name: Add PR comment
if: steps.filter.outputs.ignore == 'false'
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
with:
message: >
### 📝 PRs merging into main branch
Expand All @@ -27,4 +56,5 @@ jobs:
branch when the code complete and ready to be released.

- name: Success
if: steps.filter.outputs.ignore == 'false'
run: exit 0
Loading