From ae5f90d6f867bec96ef4ec3756d66f071d24dcd2 Mon Sep 17 00:00:00 2001 From: Enriqueta De Leon Date: Mon, 21 Oct 2024 17:01:40 -0700 Subject: [PATCH] Dependabot Configuration (#327) * remove snyk dependency scanning workflow * add dependency-submission workflow --- .github/workflows/dependency-submission.yml | 39 +++++++++++++++++++++ .github/workflows/snyk_scan.yml | 27 -------------- 2 files changed, 39 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/dependency-submission.yml delete mode 100644 .github/workflows/snyk_scan.yml diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml new file mode 100644 index 0000000..b6c6af0 --- /dev/null +++ b/.github/workflows/dependency-submission.yml @@ -0,0 +1,39 @@ +# Workflow: Dependency Graph Submission and Vulnerability Reporting +# +# Trigger: This workflow runs on every merge to the main branch. +# +# Purpose: It generates and submits a dependency graph to the GitHub Dependency Submission API. The graph is used to +# trigger Dependabot Alerts for vulnerable dependencies, and to populate the Dependency Graph insights view in GitHub. +# +# Excludes: +# - Test-only dependencies +# - Module with name 'integration_test' and 'telemetry_examples' + +name: Dependency Submission + +on: + push: + branches: [ 'main' ] + +permissions: + contents: write + +jobs: + dependency-submission: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - name: Setup Java + uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # pin@v4 + with: + distribution: 'temurin' + java-version: '11' + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@d156388eb19639ec20ade50009f3d199ce1e2808 # pin@v4 + with: + dependency-graph-exclude-configurations: '.*[Tt]est(Compile|Runtime)Classpath' + dependency-graph-exclude-projects: ':integration_test, :telemetry_examples' + build-scan-publish: true + build-scan-terms-of-use-url: "https://gralde.com/help/legal-terms-of-use" + build-scan-terms-of-use-agree: "yes" diff --git a/.github/workflows/snyk_scan.yml b/.github/workflows/snyk_scan.yml deleted file mode 100644 index 7740a37..0000000 --- a/.github/workflows/snyk_scan.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This workflow automates the process of identifying potential security vulnerabilities using Snyk. -# Dependency vulnerability scans will be run on a weekly schedule, but can also be triggered manually. -name: Snyk Vulnerability Scan -on: - workflow_dispatch: - schedule: - - cron: '00 15 * * 1' - push: - branches: - - main - -jobs: - security: - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # pin@v4 - with: - ref: 'main' - - - name: Run Snyk To Check For Vulnerabilities - uses: snyk/actions/gradle-jdk11@8349f9043a8b7f0f3ee8885bf28f0b388d2446e8 # pin@master - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - with: - command: monitor - args: --all-sub-projects --org=java-agent --configuration-matching='(^compileClasspath$)|(^runtimeClasspath$)'