lockfile_check.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Lockfile checks
  2. on:
  3. push:
  4. branches: [main]
  5. paths:
  6. - yarn.lock
  7. pull_request:
  8. # We want all branches so we configure types to be the GH default again
  9. types: [opened, synchronize, reopened]
  10. paths:
  11. - yarn.lock
  12. env:
  13. YARN_ENABLE_GLOBAL_CACHE: false
  14. jobs:
  15. lint_lockfile:
  16. name: Lint yarn.lock
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Checkout sources
  20. uses: actions/checkout@v4
  21. - name: Get yarn cache directory path
  22. id: yarn-cache-dir-path
  23. run:
  24. echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
  25. - uses: actions/cache@v4
  26. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  27. with:
  28. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  29. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  30. restore-keys: |
  31. ${{ runner.os }}-yarn-
  32. - name: Install Node.js
  33. uses: actions/setup-node@v4
  34. with:
  35. node-version: lts/*
  36. - name: Install dependencies
  37. run: corepack yarn install --immutable --mode=skip-build