mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 08:46:42 +00:00
Merge pull request #12700 from strapi/feat/lockfile-security-action
Add a lockfile check to the github actions
This commit is contained in:
commit
ec4bfad9fe
24
.github/actions/security/lockfile/action.yml
vendored
Normal file
24
.github/actions/security/lockfile/action.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: 'Analyze lockfile dependencies'
|
||||||
|
description: 'Parse dependencies from the yarn lockfile and run security tests on them'
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
description: 'Path to the yarn lockfile'
|
||||||
|
required: false
|
||||||
|
default: 'yarn.lock'
|
||||||
|
type:
|
||||||
|
description: 'Lockfile type, either yarn or npm'
|
||||||
|
default: 'yarn'
|
||||||
|
required: false
|
||||||
|
allowedHosts:
|
||||||
|
description: 'Allowed hosts for packages resolution'
|
||||||
|
required: false
|
||||||
|
default: 'https://registry.yarnpkg.com'
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- run: $GITHUB_ACTION_PATH/script.sh
|
||||||
|
env:
|
||||||
|
LOCKFILE_PATH: ${{ inputs.path }}
|
||||||
|
LOCKFILE_TYPE: ${{ inputs.type }}
|
||||||
|
LOCKFILE_ALLOWED_HOSTS: ${{ inputs.allowedHosts }}
|
||||||
|
shell: bash
|
7
.github/actions/security/lockfile/script.sh
vendored
Executable file
7
.github/actions/security/lockfile/script.sh
vendored
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
yarn global add lockfile-lint
|
||||||
|
|
||||||
|
lockfile-lint \
|
||||||
|
--type $LOCKFILE_TYPE \
|
||||||
|
--path $LOCKFILE_PATH \
|
||||||
|
--allowed-hosts $LOCKFILE_ALLOWED_HOSTS \
|
||||||
|
--validate-https
|
5
.github/workflows/checks.yml
vendored
5
.github/workflows/checks.yml
vendored
@ -17,3 +17,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./.github/actions/check-pr-status
|
- uses: ./.github/actions/check-pr-status
|
||||||
|
security-lockfile-analysis:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/actions/security/lockfile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user