Skip to content

Bump @sveltejs/kit from 2.0.0 to 2.20.6 in /SearchQnA/ui/svelte #7845

Bump @sveltejs/kit from 2.0.0 to 2.20.6 in /SearchQnA/ui/svelte

Bump @sveltejs/kit from 2.0.0 to 2.20.6 in /SearchQnA/ui/svelte #7845

Workflow file for this run

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Code Scan
permissions:
contents: read
security-events: read
on:
pull_request:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths-ignore:
- "**.md"
workflow_dispatch:
# If there is a new commit, the previous jobs will be canceled
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DOCKER_CONFIG_NAME: "commonDockerConfig"
REPO_NAME: "code-scan"
REPO_TAG: "1.0"
DOCKER_FILE_NAME: "code-scan"
CONTAINER_NAME: "code-scan"
jobs:
code-scan:
runs-on: ubuntu-latest
strategy:
matrix:
job_name: ["bandit", "hadolint"]
fail-fast: false
steps:
- name: Checkout out Repo
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2
- name: Check Dangerous Command Injection
uses: opea-project/validation/actions/check-cmd@main
with:
work_dir: ${{ github.workspace }}
- name: Docker Build
run: |
docker build -f ${{ github.workspace }}/.github/workflows/docker/${{ env.DOCKER_FILE_NAME }}.dockerfile -t ${{ env.REPO_NAME }}:${{ env.REPO_TAG }} .
- name: Docker Run
run: |
if [[ $(docker ps -a | grep -i '${{ env.CONTAINER_NAME }}'$) ]]; then
docker stop ${{ env.CONTAINER_NAME }}
docker rm -vf ${{ env.CONTAINER_NAME }} || true
fi
docker run -dit --memory="4g" --memory-reservation="1g" --disable-content-trust --privileged --name=${{ env.CONTAINER_NAME }} --shm-size="1g" \
-v ${{ github.workspace }}:/GenAIExamples \
${{ env.REPO_NAME }}:${{ env.REPO_TAG }}
- name: Code scan check
run: |
docker exec ${{ env.CONTAINER_NAME }} \
bash -c "bash /GenAIExamples/.github/workflows/scripts/codeScan/${{ matrix.job_name }}.sh"
- name: Publish pipeline artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392
with:
name: ${{ matrix.job_name }}
path: ${{ github.workspace }}/.github/workflows/scripts/codeScan/${{ matrix.job_name }}.*
shell-check:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
steps:
- name: Repository checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2
with:
fetch-depth: 0
- name: Get changed shell files
id: get-changed-files
run: |
base_commit="${{ github.event.pull_request.base.sha }}"
merged_commit="${{ github.sha }}"
echo "base_commit=${base_commit}" >> $GITHUB_ENV
echo "merged_commit=${merged_commit}" >> $GITHUB_ENV
changed_files="$(git diff --name-only --diff-filter=AM ${base_commit} ${merged_commit} | grep -E '\.sh$' | tr '\n' ' ')" || true
echo "changed_files=${changed_files}"
# echo "changed_files=${changed_files}" >> $GITHUB_ENV
if [ -z "$changed_files" ]; then
echo "changed_files_exist=false" >> $GITHUB_OUTPUT
else
echo "changed_files=${changed_files}" >> $GITHUB_OUTPUT
echo "changed_files_exist=true" >> $GITHUB_OUTPUT
fi
- name: ShellCheck
# if: ${{ env.changed_files != '' }}
if: steps.get-changed-files.outputs.changed_files_exist == 'true'
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
env:
SHELLCHECK_OPTS: -e SC2164 -e SC2154 -e SC2034 -e SC2155 -e SC1090 -e SC2153 -e SC2046
with:
# path: ${{ env.changed_files }}
scandir: .
additional_files: ${{ steps.get-changed-files.outputs.changed_files }}
severity: warning