Skip to content

Commit 3d4868b

Browse files
chore: add deduplicate-yarn workflow (#10583)
* chore: add `deduplicate-yarn` workflow * Update .github/workflows/deduplicate-yarn.yml Co-authored-by: Matt Brophy <[email protected]> --------- Co-authored-by: Matt Brophy <[email protected]>
1 parent f63774c commit 3d4868b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: ⚙️ Deduplicate yarn.lock
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
paths:
8+
- ./yarn.lock
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
format:
16+
if: github.repository == 'remix-run/react-router'
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: ⬇️ Checkout repo
21+
uses: actions/checkout@v3
22+
23+
- name: ⎔ Setup node
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version-file: ".nvmrc"
27+
cache: "yarn"
28+
29+
- name: ⚙️ Dedupe yarn.lock
30+
run: npx yarn-deduplicate && rm -rf ./node_modules && yarn
31+
32+
- name: 💪 Commit
33+
run: |
34+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
35+
git config --local user.name "github-actions[bot]"
36+
git add .
37+
if [ -z "$(git status --porcelain)" ]; then
38+
echo "💿 no deduplication needed"
39+
exit 0
40+
fi
41+
git commit -m "chore: deduplicate `yarn.lock`"
42+
git push
43+
echo "💿 https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"

0 commit comments

Comments
 (0)