mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-01 14:46:41 +02:00
Added PR based sha
This commit is contained in:
8
.github/workflows/validate-lockfile.yml
vendored
8
.github/workflows/validate-lockfile.yml
vendored
@@ -31,11 +31,11 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Ensure pnpm-lock.yaml changes only with package.json
|
- name: Ensure pnpm-lock.yaml changes only when package.json changes
|
||||||
run: |
|
run: |
|
||||||
git fetch origin ${{ github.event.pull_request.base.ref }}
|
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} > changed_files.txt
|
||||||
git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD > changed_files.txt
|
if grep -q '^pnpm-lock.yaml$' changed_files.txt && \
|
||||||
if grep -q '^pnpm-lock.yaml$' changed_files.txt && ! grep -q 'package.json' changed_files.txt; then
|
! grep -q 'package.json' changed_files.txt; then
|
||||||
echo "❌ pnpm-lock.yaml was changed without any package.json"
|
echo "❌ pnpm-lock.yaml was changed without any package.json"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user