Skip to content

Commit c154e2c

Browse files
committed
Add configs-ignore input
1 parent 1821adb commit c154e2c

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ The name of a module contains the name of the project and its binary version.
4545

4646
Example: `foo_2.13 bar_2.13`
4747

48+
#### - `configs-ignore` (optional)
49+
50+
A list of space-separated names of configurations to ignore. The action will not submit the dependencies of these configurations.
51+
52+
Example of configurations are `compile`, `test`, `scala-tool`, `scala-doc-tool`.
53+
4854
#### - `token` (optional)
4955

5056
GitHub Personal Access Token (PAT). Defaults to PAT provided by Action runner.
@@ -53,6 +59,8 @@ Example: `${{ secrets.USER_TOKEN }}`
5359

5460
#### Example
5561

62+
##### Excluding some projects or some Scala versions from the dependency submission.
63+
5664
In this example the snapshot will not contain the graphs of `foo_2.13` and `bar_3`.
5765

5866
```yaml
@@ -67,6 +75,22 @@ steps:
6775
modules-ignore: foo_2.13 bar_3
6876
```
6977

78+
#### Excluding the Scaladoc dependencies.
79+
80+
In this example the snapshot will not contain the dependencies of the scala-doc-tool configuration.
81+
82+
```yaml
83+
84+
## in .github/workflows/dependency-graph.md
85+
...
86+
steps:
87+
- uses: actions/checkout@v3
88+
- uses: scalacenter/sbt-dependency-submission@v2
89+
with:
90+
base-dir: ./my-scala-project
91+
configs-ignore: scala-doc-tool
92+
```
93+
7094
## Troubleshooting
7195

7296
### Unexpected Status: 404

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ inputs:
1616
Example: `foo_2.13 bar_2.13`
1717
required: false
1818
default: ''
19+
configs-ignore:
20+
description: |
21+
A list of space-separated names of configurations to ignore. The action will not submit the dependencies of these configurations.
22+
Example: `test scala-doc-tool`
23+
required: false
24+
default: ''
1925
on-resolve-failure:
2026
description: |
2127
Either 'error' or 'warning'.

src/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ async function run(): Promise<void> {
3535
.split(' ')
3636
.filter(value => value.length > 0)
3737

38+
const ignoredConfigs = core
39+
.getInput('configs-ignore')
40+
.split(' ')
41+
.filter(value => value.length > 0)
42+
3843
const onResolveFailure = core.getInput('on-resolve-failure')
3944
if (!['error', 'warning'].includes(onResolveFailure)) {
4045
core.setFailed(
@@ -43,7 +48,7 @@ async function run(): Promise<void> {
4348
return
4449
}
4550

46-
const input = { ignoredModules, onResolveFailure }
51+
const input = { ignoredModules, ignoredConfigs, onResolveFailure }
4752

4853
process.env['GITHUB_TOKEN'] = token
4954
await cli.exec('sbt', [`githubSubmitDependencyGraph ${JSON.stringify(input)}`], {

0 commit comments

Comments
 (0)