Skip to content

Commit 7ec6a7b

Browse files
thinkasanyafc163Wxh16144
authored
chore(ci): add workflow trigger conditions (ant-design#48090)
* chore(ci): add workflow trigger conditions Co-authored-by: wanpan11 <[email protected]> * Apply suggestions from code review Co-authored-by: 红 <[email protected]> Signed-off-by: afc163 <[email protected]> --------- Signed-off-by: afc163 <[email protected]> Co-authored-by: afc163 <[email protected]> Co-authored-by: 红 <[email protected]>
1 parent 6681acd commit 7ec6a7b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/pr-contributor-welcome.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ jobs:
1919
if: github.event.pull_request.merged == true && github.repository == 'ant-design/ant-design'
2020
runs-on: ubuntu-latest
2121
steps:
22+
- name: get commit count
23+
id: get_commit_count
24+
run: |
25+
PR_AUTHOR=$(echo "${{ github.event.pull_request.user.login }}")
26+
RESULT_DATA=$(curl -s "https://api.github.com/repos/${{ github.repository }}/commits?author=${PR_AUTHOR}&per_page=5")
27+
DATA_LENGTH=$(echo $RESULT_DATA | jq 'if type == "array" then length else 0 end')
28+
echo "COUNT=$DATA_LENGTH" >> $GITHUB_OUTPUT
2229
- name: Comment on PR
30+
if: steps.get_commit_count.outputs.COUNT < 3
2331
uses: actions-cool/maintain-one-comment@v3
2432
with:
2533
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)