Skip to content

Conversation

@Bojan131
Copy link
Contributor

add github actions that checks if package-lock is not deleted

Comment on lines 8 to 13
push:
branches:
- "**" # Run on push to any branch
pull_request:
branches:
- "**" # Run on PR to any branch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will trigger twice for branches where we have a pull request open

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah good catch, i made them now run only on PR and when pushed to the main branch

@zsculac
Copy link
Contributor

zsculac commented Jan 22, 2026

The current check verifies that the file exists and it isn't empty. It won't catch invalid json or if the lock is out of sync with package json. What do you say we add something like this to encapsulate those checks too:

   - name: Setup Node.js
     uses: actions/setup-node@v4
     with:
       node-version: '22'

   - name: Validate package-lock.json is valid and in sync
     run: npm ci --dry-run --ignore-scripts

@Bojan131
Copy link
Contributor Author

The current check verifies that the file exists and it isn't empty. It won't catch invalid json or if the lock is out of sync with package json. What do you say we add something like this to encapsulate those checks too:

   - name: Setup Node.js
     uses: actions/setup-node@v4
     with:
       node-version: '22'

   - name: Validate package-lock.json is valid and in sync
     run: npm ci --dry-run --ignore-scripts

Thanks for the recommendation, good call i implemented that as well

@Bojan131 Bojan131 merged commit 5edd9e8 into main Jan 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants