Skip to content

Commit d152801

Browse files
committed
Share dependency-submission workflow
Previously the dependency-submission action was used in 2 different workflows, one for dependency-submission on pushes to `main` and another for depenency-review. This setup can lead to duplicate dependencies in the GitHub Dependency Insights, due to some odd behaviour in handling dependency submission. We now use a single workflow Job for all dependency-submission, and use the dependency-review-action in the "wait for snapshot" mode. This setup is now recommended in the docs for `gradle/actions/dependency-submission`.
1 parent d9e9a10 commit d152801

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed
+5-23
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
1-
# Submits a dependency graph and performs dependency review on every pull request
2-
name: Dependency review for pull requests
1+
name: Dependency Review
32

43
on:
54
pull_request:
65

76
permissions:
8-
contents: write
7+
contents: read
98

109
jobs:
11-
dependency-submission:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Checkout sources
15-
uses: actions/checkout@v4
16-
17-
- name: Set up the JDK used to run Gradle
18-
uses: actions/setup-java@v4
19-
with:
20-
distribution: 'temurin'
21-
java-version: '17'
22-
23-
- name: Generate and submit dependency graph for the PR
24-
uses: gradle/actions/dependency-submission@v4
25-
with:
26-
build-scan-publish: true
27-
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
28-
build-scan-terms-of-use-agree: "yes"
29-
3010
dependency-review:
31-
needs: dependency-submission
3211
runs-on: ubuntu-latest
3312
steps:
3413
- name: Perform dependency review
3514
uses: actions/dependency-review-action@v4
15+
with:
16+
retry-on-snapshot-warnings: true
17+
retry-on-snapshot-warnings-timeout: 600

.github/workflows/dependency-submission.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# Submits a dependency graph on every push to 'main'
21
name: Dependency Submission
32

43
on:
54
push:
6-
branches:
7-
- main
5+
branches: [ 'main' ]
6+
pull_request:
87

98
permissions:
109
contents: write

0 commit comments

Comments
 (0)