From 5fa31c1e8f42e855841c64ed5e1e00e1231837ad Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Sat, 30 Dec 2023 11:55:25 +0800 Subject: [PATCH] chore: use issues-helper --- .changeset/tough-shirts-tan.md | 4 +-- .github/workflows/changeset-check.yml | 41 +++++++++++---------------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/.changeset/tough-shirts-tan.md b/.changeset/tough-shirts-tan.md index 8da5e9283..5fa514e73 100644 --- a/.changeset/tough-shirts-tan.md +++ b/.changeset/tough-shirts-tan.md @@ -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 diff --git a/.github/workflows/changeset-check.yml b/.github/workflows/changeset-check.yml index a00546981..4a0d7e8ac 100644 --- a/.github/workflows/changeset-check.yml +++ b/.github/workflows/changeset-check.yml @@ -25,10 +25,6 @@ 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" @@ -36,19 +32,21 @@ jobs: 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 @@ -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'