Skip to content

Commit

Permalink
Tweak GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Dec 19, 2024
1 parent 59739a6 commit a3031de
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/verify-yarn-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,23 @@ jobs:
with:
node-version-file: .nvmrc

- name: Verify yarn.lock
- name: Reset yarn.lock to base
run: git show "origin/${{ github.base_ref }}:yarn.lock" > yarn.lock

- name: Yarn install
uses: Wandalen/wretry.action@master
with:
command: |
git show "origin/${{ github.base_ref }}:yarn.lock" > yarn.lock
yarn
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
}
# Fine to skip scripts since we don't run any code
command: yarn install --ignore-scripts
attempt_limit: 3
attempt_delay: 2000

- 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
}

0 comments on commit a3031de

Please sign in to comment.