From 08eb87e7d39a806bf1c381ad56e4e5d32620ae36 Mon Sep 17 00:00:00 2001 From: Bartosz Date: Tue, 10 Sep 2024 17:43:35 +0200 Subject: [PATCH] chore: Fix github actions --- .github/actions/deduplicate/action.yml | 6 ++++-- .github/workflows/check-pr.yml | 2 +- .github/workflows/deduplicate.yml | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) 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..2bb0c11 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -57,7 +57,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }); - if (!comments.find(c => c.body.includes('is not deduplicated. You can try deduplicating'))) { + if (!comments.data.find(c => c.body.includes('is not deduplicated. You can try deduplicating'))) { github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, diff --git a/.github/workflows/deduplicate.yml b/.github/workflows/deduplicate.yml index ed4dadc..8b493a9 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 + }); + return pull.data.head.ref; - name: Check out the repository uses: actions/checkout@v4