-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7428550
commit eca6e8a
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
'@ant-design/web3-assets': major | ||
'@ant-design/web3-common': minor | ||
'@ant-design/web3-icons': patch | ||
'@ant-design/web3-wagmi': patch | ||
'@ant-design/web3': patch | ||
--- | ||
|
||
chore: ONLY FOR TEST CI, DO NOT MERGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: PR Changeset Check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
check_changeset: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check for major changes | ||
run: | | ||
changed_files=$(git diff --name-only HEAD..HEAD~1) | ||
major_changes=$(echo "$changed_files" | grep ".changeset" | grep -c "major") | ||
if [ "$major_changes" -gt 0 ]; then | ||
comment="@${{ github.actor }}, 本次 PR 的更改包含 major 变更,请确认是否符合预期。<!-- AUTO_CHANGESET_CHECK_HOOK -->" | ||
echo "$comment" > comment_body.txt | ||
echo "comment=$comment" >> $GITHUB_OUTPUT | ||
else | ||
echo "comment=" >> $GITHUB_OUTPUT | ||
fi | ||
# Save PR id to output | ||
- name: save PR id | ||
id: pr | ||
run: echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT | ||
|
||
add_comment: | ||
needs: check_changeset | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.check_changeset.outputs.comment != '' }} | ||
|
||
steps: | ||
- name: update status comment | ||
uses: actions-cool/maintain-one-comment@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
body: ${{ needs.check_changeset.outputs.comment }} | ||
body-include: '<!-- AUTO_CHANGESET_CHECK_HOOK -->' | ||
number: ${{ steps.pr.outputs.id }} | ||
|
||
delete_comment: | ||
needs: check_changeset | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.check_changeset.outputs.comment == '' }} | ||
|
||
steps: | ||
- name: Delete comment | ||
uses: actions-cool/maintain-one-comment@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
body-include: '<!-- AUTO_CHANGESET_CHECK_HOOK -->' | ||
number: ${{ steps.pr.outputs.id }} | ||
delete: true |