Skip to content

Commit cbdf983

Browse files
authored
Merge 17565f8 into 1e2e2c1
2 parents 1e2e2c1 + 17565f8 commit cbdf983

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

.github/workflows/merge-to-main.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,45 @@ on:
66
- main
77
types:
88
- opened
9-
- labeled
10-
- unlabeled
9+
- synchronize
1110

1211
jobs:
1312
pr-message:
1413
runs-on: ubuntu-latest
1514
permissions:
1615
pull-requests: write
1716
steps:
18-
- uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
17+
- name: Checkout repo
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
with:
20+
fetch-depth: 0
21+
submodules: false
22+
23+
- name: Filter paths
24+
id: filter
25+
run: |
26+
MERGE_BASE=$(git merge-base origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF})
27+
FILES=$(git diff --name-only $MERGE_BASE origin/${GITHUB_HEAD_REF})
28+
IGNORE=true
29+
for FILE in $FILES; do
30+
if [[ $FILE != plugins/* && $FILE != .github/* ]]; then
31+
IGNORE=false
32+
break
33+
fi
34+
done
35+
36+
if $IGNORE; then
37+
echo "ignore=true" >> $GITHUB_OUTPUT
38+
echo "Filter result code: ignore = true"
39+
else
40+
echo "ignore=false" >> $GITHUB_OUTPUT
41+
echo "Filter result code: ignore = false"
42+
fi
43+
shell: bash
44+
45+
- name: Add PR comment
46+
if: steps.filter.outputs.ignore == 'false'
47+
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
1948
with:
2049
message: >
2150
### 📝 PRs merging into main branch
@@ -27,4 +56,5 @@ jobs:
2756
branch when the code complete and ready to be released.
2857
2958
- name: Success
59+
if: steps.filter.outputs.ignore == 'false'
3060
run: exit 0

0 commit comments

Comments
 (0)