generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactor/copyright-file-headers
- Loading branch information
Showing
4 changed files
with
64 additions
and
25 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,9 @@ on: | |
default: minor | ||
|
||
env: | ||
CVE_CACHE_DIR: ~/.m2/repository/org/owasp/dependency-check-data/9.0/** | ||
CVE_CACHE_KEY: "cve-cache" | ||
# keep the below two variables in sync with the ones in .github/workflows/update-vulnerability-database.yaml | ||
CVE_CACHE_KEY: cve-db | ||
CVE_CACHE_DIR: ~/.m2/repository/org/owasp/dependency-check-data | ||
|
||
jobs: | ||
release: | ||
|
@@ -37,12 +38,13 @@ jobs: | |
with: | ||
distribution: 'adopt' | ||
java-version: 8 | ||
- name: Restore Vulnerabilities Database | ||
id: restore-cve | ||
|
||
- name: Restore CVE Database | ||
uses: actions/cache/restore@v4 | ||
with: | ||
key: ${{ env.CVE_CACHE_KEY }} | ||
path: ${{ env.CVE_CACHE_DIR }} | ||
key: ${{ env.CVE_CACHE_KEY }} | ||
fail-on-cache-miss: true | ||
|
||
- name: Bump Version | ||
id: bump-version | ||
|
@@ -53,13 +55,6 @@ jobs: | |
- name: Build Project | ||
run: mvn clean install -P release -Dgpg.skip | ||
|
||
- name: Store Vulnerabilities Database | ||
if: ${{ steps.restore-cve.outputs.cache-hit != 'true' }} | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ${{ env.CVE_CACHE_DIR }} | ||
key: ${{ env.CVE_CACHE_KEY }} | ||
|
||
- name: Commit Changes | ||
run: | | ||
git config --global user.email "[email protected]" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Update Vulnerability Database | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '17 5 * * *' # use a somewhat random time to avoid producing load spikes on the GH actions infrastructure | ||
|
||
env: | ||
CVE_CACHE_REF: refs/heads/main | ||
CVE_CACHE_KEY: cve-db | ||
CVE_CACHE_DIR: ~/.m2/repository/org/owasp/dependency-check-data | ||
|
||
jobs: | ||
update-vulnerability-database: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.CVE_CACHE_REF }} | ||
- name: Restore Existing Cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ env.CVE_CACHE_DIR }} | ||
key: ${{ env.CVE_CACHE_KEY }} | ||
|
||
- name: Run Maven Plugin | ||
run: | | ||
mvn org.owasp:dependency-check-maven:update-only -DnvdMaxRetryCount=10 -DnvdApiDelay=15000 -DconnectionTimeout=60000 | ||
- name: Delete Cache | ||
run: | | ||
CACHE_IDS=$(gh cache list --key "${{ env.CVE_CACHE_KEY }}" --ref "${{ env.CVE_CACHE_REF }}" --json id | jq -r '.[] | .id') | ||
for CACHE_ID in $CACHE_IDS; do | ||
echo "Deleting cache with ID: $CACHE_ID" | ||
gh cache delete "${CACHE_ID}" | ||
done | ||
env: | ||
GH_TOKEN: ${{ secrets.CLOUD_SDK_AT_SAP_ALL_ACCESS_PAT }} | ||
|
||
- name: Cache CVE Database | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ${{ env.CVE_CACHE_DIR }} | ||
key: ${{ env.CVE_CACHE_KEY }} | ||
|
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