[Snyk] Fix for 1 vulnerabilities #83
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
name: run on pull request [v6] | |
on: | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
run-on-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: setup env | |
id: node-version | |
run: | | |
docker build -t mew-build-container . | |
echo ::set-output name=NODE_VERSION::$(docker run --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "node --version") | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{steps.node-version.outputs.NODE_VERSION}}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{steps.node-version.outputs.NODE_VERSION}}- | |
- name: npm install | |
run: docker run --rm -v `pwd`:/home:rw --user "$(id -u):$(id -g)" mew-build-container /bin/bash -c "npm install" | |
- name: build | |
run: docker run --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "npm run build:hash" | |
- name: add to codecov | |
run: | | |
ci_env='-e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID' | |
docker run $ci_env --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "npm run codecov" | |
- name: upload to codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
fail_ci_if_error: true |