-
Notifications
You must be signed in to change notification settings - Fork 54
47 lines (39 loc) · 1.38 KB
/
yarn-deduplicate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: yarn-deduplicate
on:
pull_request:
paths:
- "yarn.lock"
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
permissions:
contents: write
deployments: read
pull-requests: write # needed to write comment in PR
jobs:
dedupe:
runs-on: ubuntu-latest
name: Deduplicate
environment: pull_request_unsafe
steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Use Node.js
uses: ./.github/actions/setup-node
- name: yarn-deduplicate
id: deduplicate
run: |
yarn
yarn yarn-deduplicate
echo "::set-output name=diff::$(git status --short yarn.lock)"
- name: Commit dedupe
if: steps.deduplicate.outputs.diff
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 #1.4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: "chore: yarn-deduplicate"
branch: ${{ github.head_ref }}