fix(security): replace adm-zip with yauzl/yazl (GHSA-vwc7-r8mq-g2x9) #4183
Workflow file for this run
This file contains hidden or 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
| # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
| name: Node.js CI | |
| on: | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| issues: write | |
| strategy: | |
| matrix: | |
| node-version: [22] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Check npm audit | |
| run: npm audit --omit=dev --audit-level=low | |
| - name: Install production dependencies (fail if any warning) | |
| run: | | |
| npm ci --omit=dev --ignore-scripts | |
| # sh ./npm-production-install.sh | |
| - name: Install dependencies | |
| run: | | |
| npm config set registry http://registry.npmjs.org | |
| npm ci | |
| - name: Install Compodoc | |
| run: npm i -g @compodoc/compodoc | |
| - name: Generate development documentation and test level of documentation coverage | |
| run: npm run doc | |
| - name: Check code style | |
| run: npm run lint | |
| - name: Build Project | |
| run: npm run build | |
| - name: Test Package Install | |
| run: | | |
| npm version "5.0.0" --no-git-tag-version | |
| npm pack | |
| npm install -g ./sasjs-cli-5.0.0.tgz | |
| sasjs v | |
| - name: Run smoke tests | |
| run: sh ./test.sh | |
| - name: Install Doxygen | |
| run: sudo apt-get install -y doxygen | |
| # Mocked (*.spec.ts) tests will be conducted during this step | |
| - name: Generate coverage report | |
| uses: artiomtr/[email protected] | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| test-script: npx jest --config=jest.config.js --silent --runInBand --ci --coverage --testLocationInResults --json --outputFile="report.json" | |
| - name: Install PM2 | |
| run: npm i -g pm2 | |
| - name: Create .env file for sasjs/server | |
| run: | | |
| echo "RUN_TIMES=js" >> .env | |
| echo "NODE_PATH=node" >> .env | |
| echo "MOCK_SERVERTYPE=sas9" >> .env | |
| - name: Download sasjs/server package | |
| run: curl -L https://github.com/sasjs/server/releases/latest/download/linux.zip -o linux.zip | |
| - name: Unzip downloaded package | |
| run: unzip linux.zip | |
| - name: Run sasjs server | |
| run: pm2 start api-linux | |
| - name: Wait for sasjs server to be ready | |
| run: | | |
| for i in $(seq 1 60); do | |
| if curl -sf -m 5 http://localhost:5000/SASjsApi/info > /dev/null 2>&1; then | |
| echo "sasjs server is ready" | |
| exit 0 | |
| fi | |
| echo "waiting for sasjs server ($i/60)..." | |
| sleep 5 | |
| done | |
| echo "sasjs server failed to start" | |
| pm2 logs api-linux --nostream --lines 50 | |
| exit 1 | |
| - name: Deploy SAS9 tests | |
| run: | | |
| cd mocks | |
| sasjs cbd | |
| cd .. | |
| ls sasjs_root -R | |
| - name: Run server tests | |
| run: npm run test:server | |
| env: | |
| CI: true | |
| CLIENT: ${{ secrets.CLIENT }} | |
| SECRET: ${{ secrets.SECRET }} | |
| SAS_USERNAME: ${{ secrets.SAS_USERNAME }} | |
| SAS_PASSWORD: ${{ secrets.SAS_PASSWORD }} | |
| VIYA_SERVER_URL: ${{ secrets.VIYA_SERVER_URL }} | |
| SAS9_SERVER_URL: http://localhost:5000 | |
| SASJS_SERVER_URL: http://localhost:5000 | |
| ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
| REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} |