Skip to content

Commit

Permalink
chore: Fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
burtek committed Sep 10, 2024
1 parent 50bd9ac commit e0b60ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/actions/deduplicate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ 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
yarn-deduplicate --strategy fewer --packages @types/node # @types/node@* causes unneeded duplication in highest mode
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/deduplicate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e0b60ee

Please sign in to comment.