From bdaa3f693aa7619543a8c4fda72f08a0abb43232 Mon Sep 17 00:00:00 2001 From: shubham-mermaid Date: Fri, 20 Jun 2025 13:11:33 +0530 Subject: [PATCH] Added PR based sha --- .github/workflows/validate-lockfile.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate-lockfile.yml b/.github/workflows/validate-lockfile.yml index b9661a75b..3ac5b5314 100644 --- a/.github/workflows/validate-lockfile.yml +++ b/.github/workflows/validate-lockfile.yml @@ -31,11 +31,11 @@ jobs: exit 1 fi - - name: Ensure pnpm-lock.yaml changes only with package.json + - name: Ensure pnpm-lock.yaml changes only when package.json changes run: | - git fetch origin ${{ github.event.pull_request.base.ref }} - git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD > changed_files.txt - if grep -q '^pnpm-lock.yaml$' changed_files.txt && ! grep -q 'package.json' changed_files.txt; then + git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} > changed_files.txt + if grep -q '^pnpm-lock.yaml$' changed_files.txt && \ + ! grep -q 'package.json' changed_files.txt; then echo "❌ pnpm-lock.yaml was changed without any package.json" exit 1 fi