name: Lockfile on: pull_request: concurrency: group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" cancel-in-progress: true jobs: verify-yarn-lock: name: No manual yarn.lock edits runs-on: ubuntu-latest steps: - name: Check out PR HEAD uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 - name: Fetch base branch env: BASE_REF: ${{ github.base_ref }} run: git fetch origin $BASE_REF --depth=1 - name: Install node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: .nvmrc - name: Reset yarn.lock to base env: BASE_REF: ${{ github.base_ref }} run: git show "origin/$BASE_REF:yarn.lock" > yarn.lock - name: ⚙️ Install dependencies run: yarn install --ignore-scripts - name: Verify yarn.lock run: | git diff --quiet --exit-code || { echo '::error::`yarn.lock` does not match what Yarn would generate given the base `yarn.lock` and the head `package.json`.' echo '::error:: - If this is intentional, you can ignore this check.' echo '::error:: - If this is unintentional, apply the following diff:' git --no-pager diff exit 1 }