Skip to content

Commit

Permalink
chore: add deduplicate-yarn workflow (#6109)
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <[email protected]>
Co-authored-by: Michaël De Boey <[email protected]>
  • Loading branch information
mcansh and MichaelDeBoey authored Aug 8, 2023
1 parent 8bc1b13 commit b2d8691
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deduplicate-yarn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: ⚙️ Deduplicate yarn.lock

on:
push:
branches:
- dev
paths:
- ./yarn.lock

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format:
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"

- name: ️️⚙️ Dedupe yarn.lock
run: npx yarn-deduplicate && rm -rf ./node_modules && yarn

- name: 💪 Commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "💿 no deduplication needed"
exit 0
fi
git commit -m "chore: deduplicate `yarn.lock`"
git push
echo "💿 https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"

0 comments on commit b2d8691

Please sign in to comment.