Skip to content

Commit b87ecbb

Browse files
authored
Add retry for the unstable steps in daily_scan workflow (#1061)
*Description of changes:* add retry step for `Install and run dependency scan` which has higher transient failure rate. https://github.com/aws-observability/aws-otel-java-instrumentation/actions/runs/13637396412/job/38119414216 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: $(git --no-pager log --format=format:'%an' -n 1) <$(git --no-pager log --format=format:'%ae' -n 1)>
1 parent 5477274 commit b87ecbb

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/owasp.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,18 @@ jobs:
5959
- name: Install and run dependency scan
6060
id: dep_scan
6161
if: always()
62-
run: |
63-
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 259A55407DD6C00299E6607EFFDE55BE73A2D1ED
64-
VERSION=$(curl -s https://jeremylong.github.io/DependencyCheck/current.txt | head -n1 | cut -d' ' -f1)
65-
curl -Ls "https://github.com/dependency-check/DependencyCheck/releases/download/v$VERSION/dependency-check-$VERSION-release.zip" --output dependency-check.zip
66-
curl -Ls "https://github.com/dependency-check/DependencyCheck/releases/download/v$VERSION/dependency-check-$VERSION-release.zip.asc" --output dependency-check.zip.asc
67-
gpg --verify dependency-check.zip.asc
68-
unzip dependency-check.zip
69-
./dependency-check/bin/dependency-check.sh --failOnCVSS 0 --nvdApiKey ${{ env.NVD_API_KEY_NVD_API_KEY }} -s 'otelagent/build/libs/aws-opentelemetry-agent-*-SNAPSHOT.jar'
62+
uses: ./.github/actions/execute_and_retry
63+
with:
64+
command: 'gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 259A55407DD6C00299E6607EFFDE55BE73A2D1ED &&
65+
VERSION=$(curl -s https://jeremylong.github.io/DependencyCheck/current.txt | head -n1 | cut -d' ' -f1) &&
66+
curl -Ls "https://github.com/dependency-check/DependencyCheck/releases/download/v$VERSION/dependency-check-$VERSION-release.zip" --output dependency-check.zip &&
67+
curl -Ls "https://github.com/dependency-check/DependencyCheck/releases/download/v$VERSION/dependency-check-$VERSION-release.zip.asc" --output dependency-check.zip.asc &&
68+
gpg --verify dependency-check.zip.asc &&
69+
unzip dependency-check.zip &&
70+
./dependency-check/bin/dependency-check.sh --failOnCVSS 0 --nvdApiKey ${{ env.NVD_API_KEY_NVD_API_KEY }} -s "otelagent/build/libs/aws-opentelemetry-agent-*-SNAPSHOT.jar"'
71+
cleanup: 'rm -f ./dependency-check.zip && rm -f ./dependency-check.zip.asc && rm -rf ./dependency-check || true'
72+
max_retry: 5
73+
sleep_time: 60
7074

7175
- name: Print dependency scan results on failure
7276
if: ${{ steps.dep_scan.outcome != 'success' }}

0 commit comments

Comments
 (0)