Skip to content

Commit

Permalink
chore: use issues-helper
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkasany committed Dec 30, 2023
1 parent 24b501c commit 5fa31c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .changeset/tough-shirts-tan.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'@ant-design/web3-assets': major
'@ant-design/web3-common': major
'@ant-design/web3-assets': patch
'@ant-design/web3-common': patch
'@ant-design/web3-wagmi': patch
'@ant-design/web3-icons': patch
'@ant-design/web3': patch
Expand Down
41 changes: 16 additions & 25 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,28 @@ jobs:
id: check_changeset
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ant-design
REPO: ant-design-web3
LABEL_NAME: major
run: |
files=$ALL_CHANGED_FILES
echo "File list: $files"
if grep -q "major" "$files"; then
major_changes=$(grep "major" $files)
echo "Found major changes."
echo "comment=$major_changes" >> $GITHUB_OUTPUT
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${OWNER}/${REPO}/issues/${{ github.event.pull_request.number }}/labels" \
-f "labels[]=${LABEL_NAME}" \
-t "${{ secrets.GITHUB_TOKEN }}"
else
echo "Not found major changes."
comment=""
echo "comment=$comment" >> $GITHUB_OUTPUT
fi
- name: Add label
if: ${{ steps.check_changeset.outputs.comment != '' }}
uses: actions-cool/issues-helper@v3
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
labels: 'major'

- name: update status comment
if: ${{ steps.check_changeset.outputs.comment != '' }}
uses: actions-cool/maintain-one-comment@v3
Expand Down Expand Up @@ -76,18 +74,11 @@ jobs:
number: ${{ github.event.pull_request.number }}
delete: true

- name: Delete label
- name: Remove labels
if: ${{ steps.check_changeset.outputs.comment == '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ant-design
REPO: ant-design-web3
LABEL_NAME: major
run: |
echo "Deleting label..."
gh api \
--method DELETE \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${OWNER}/${REPO}/labels/${LABEL_NAME}" \
-t "${GITHUB_TOKEN}" || true
uses: actions-cool/issues-helper@v3
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
labels: 'major'

0 comments on commit 5fa31c1

Please sign in to comment.