Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/github-actions-c3e…
Browse files Browse the repository at this point in the history
…d15e864
  • Loading branch information
Johannes-Schneider authored Mar 27, 2024
2 parents 08b3c77 + bccec93 commit 106034d
Show file tree
Hide file tree
Showing 49 changed files with 68 additions and 200 deletions.
8 changes: 0 additions & 8 deletions .codestyle/intellij_copyright.xml

This file was deleted.

19 changes: 7 additions & 12 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:
branches: [ main ]

env:
CVE_CACHE_DIR: ~/.m2/repository/org/owasp/dependency-check-data/**
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:
build:
Expand All @@ -25,12 +26,13 @@ jobs:
with:
distribution: 'adopt'
java-version: ${{ matrix.java-version }}
- 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: Build with Maven
run: mvn clean install -Dgpg.skip --no-transfer-progress
Expand All @@ -40,10 +42,3 @@ jobs:
echo -e "Following files need to be formatted: \n$(git diff --name-only)"
exit 1
fi
- 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 }}
19 changes: 7 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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]"
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/update-vulnerability-database.yaml
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 }}

1 change: 1 addition & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ Files:
pom.xml
**/pom.xml
*/src/*
*/.scripts/*
Copyright: 2022 SAP SE or an SAP affiliate company and BTP Environment for Java contributors
License: Apache-2.0
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.time.Duration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api.exception;

import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.time.Duration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api.exception;

import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api.exception;

import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import com.sap.cloud.environment.servicebinding.api.exception.UnsupportedPropertyTypeException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import com.sap.cloud.environment.servicebinding.api.exception.UnsupportedPropertyTypeException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api.exception;

import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import com.sap.cloud.environment.servicebinding.api.exception.UnsupportedPropertyTypeException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding.api;

import org.junit.jupiter.api.Test;
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.2</version>
<!-- don't use a property here to not manage consumer versions -->
<extensions>true</extensions>
<executions>
Expand Down
2 changes: 1 addition & 1 deletion modules-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.2</version>
<!-- don't use a property here to not manage consumer versions -->
<extensions>true</extensions>
<executions>
Expand Down
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<maven.version>3.8</maven.version>
<java.failOnWarning>true</java.failOnWarning>
<skipTests>false</skipTests>
<updateCveDatabase>false</updateCveDatabase>
<project.rootdir>${project.basedir}</project.rootdir>
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -72,7 +73,7 @@
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.2.1</maven-gpg-plugin.version>
<maven-gpg-plugin.version>3.2.2</maven-gpg-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<dependency-check-maven-plugin.version>9.0.10</dependency-check-maven-plugin.version>
<sortpom-maven-plugin.version>2.15.0</sortpom-maven-plugin.version>
Expand Down Expand Up @@ -249,6 +250,7 @@
<skipProvidedScope>true</skipProvidedScope>
<failBuildOnCVSS>7</failBuildOnCVSS>
<suppressionFile>.etc/suppression.xml</suppressionFile>
<autoUpdate>${updateCveDatabase}</autoUpdate>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -496,4 +498,4 @@
</build>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding;

import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding;

import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.environment.servicebinding;

import java.io.IOException;
Expand Down
Loading

0 comments on commit 106034d

Please sign in to comment.