From e2f91b16e99002637c069562426781173e0e8ab5 Mon Sep 17 00:00:00 2001 From: Rodrigo Del Angel Gerardo <20210658@uthh.edu.mx> Date: Mon, 15 Apr 2024 22:58:36 -0600 Subject: [PATCH] Correccion en sonarl --- .github/workflows/snyk_scan.yml | 3 +-- .github/workflows/sonar_scan.yml | 24 ++++-------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/snyk_scan.yml b/.github/workflows/snyk_scan.yml index 7edcbfe..06987fe 100644 --- a/.github/workflows/snyk_scan.yml +++ b/.github/workflows/snyk_scan.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - token: ${{ secrets.MY_GH_TOKEN }} # AquĆ­ usamos el PAT en lugar del GITHUB_TOKEN + token: ${{ secrets.MY_GH_TOKEN }} - name: Install Snyk CLI run: npm install -g snyk @@ -30,7 +30,6 @@ jobs: run: | set +e snyk monitor --all-projects --org=6ce58cdd-2e65-4c0c-bbe5-705980cee5fe - # ejecuta la prueba con snyk snyk test --all-projects --org=6ce58cdd-2e65-4c0c-bbe5-705980cee5fe # en esta variable guarda el resultado de la prueba puede ser 1 o 0 TEST_RESULT=$? diff --git a/.github/workflows/sonar_scan.yml b/.github/workflows/sonar_scan.yml index 8577d0e..d232096 100644 --- a/.github/workflows/sonar_scan.yml +++ b/.github/workflows/sonar_scan.yml @@ -1,14 +1,12 @@ -name: SonarCloud Security Scan - +name: Build on: push: branches: - main pull_request: - workflow_dispatch: - + types: [opened, synchronize, reopened] jobs: - sonarcloud_security_scan: + sonarcloud: name: SonarCloud runs-on: ubuntu-latest steps: @@ -19,18 +17,4 @@ jobs: uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - name: Check vulnerabilities - run: | - # si el resultado del test es diferente de 0 - if [ $? -ne 0 ]; then - echo "Vulnerabilities found. Reverting to previous version..." - git config --global user.email "20210658@uthh.edu.mx" - git config --global user.name "rodrigo3829l" - git reset --hard HEAD^ - git push https://github.com/rodrigo3829l/db_api_mygarden_llc.git --force - else - echo "No vulnerabilities found. Proceeding with the current version..." - fi - - + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file