diff --git a/.github/actions/deduplicate/action.yml b/.github/actions/deduplicate/action.yml index 95245a2..2acd455 100644 --- a/.github/actions/deduplicate/action.yml +++ b/.github/actions/deduplicate/action.yml @@ -9,7 +9,8 @@ runs: using: "composite" steps: - name: Run yarn-deduplicate (highest) - if: ${{ env.STRATEGY == 'highest' }} + if: ${{ inputs.strategy == 'highest' }} + shell: bash run: | yarn global add yarn-deduplicate yarn-deduplicate --strategy highest @@ -17,7 +18,8 @@ runs: yarn - name: Run yarn-deduplicate (fewer) - if: ${{ env.STRATEGY == 'fewer' }} + if: ${{ inputs.strategy == 'fewer' }} + shell: bash run: | yarn global add yarn-deduplicate yarn-deduplicate --strategy fewer --exclude @types/unist # @types/unist gets downgraded in this mode diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index 5d464b8..1c29872 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -56,7 +56,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - }); + }).then(d => d.json()); if (!comments.find(c => c.body.includes('is not deduplicated. You can try deduplicating'))) { github.rest.issues.createComment({ issue_number: context.issue.number, diff --git a/.github/workflows/deduplicate.yml b/.github/workflows/deduplicate.yml index ed4dadc..a5bb6cb 100644 --- a/.github/workflows/deduplicate.yml +++ b/.github/workflows/deduplicate.yml @@ -22,12 +22,13 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: 'Ok, trying to deduplicate using strategy `${{ env.STRATEGY }}`' - }) - return (await github.rest.pulls.get({ + }); + var pull = await github.rest.pulls.get({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.issue.number - })).data.head.ref + }).then(d => d.json()); + return pull.data.head.ref; - name: Check out the repository uses: actions/checkout@v4