Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8de3a6
commit 807be0a
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: 'Lockfile' | ||
description: 'Forbid non-npm lockfiles' | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Check lockfiles | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const {existsSync} = require('fs'); | ||
['yarn.lock', 'pnpm-lock.yaml'].forEach(forbiddenLockFile => { | ||
if(existsSync(forbiddenLockFile)) { | ||
const error = `Lockfile ${forbiddenLockFile} is not allowed in this repo, remove it.`; | ||
core.error( | ||
error, | ||
{title: 'Forbidden lockfile', file: forbiddenLockFile} | ||
); | ||
core.setFailed(error); | ||
} | ||
}); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters