Skip to content

Commit 01793f4

Browse files
authored
Merge pull request #41 from scalacenter/modules-ignore
Introduce modules-ignore to replace projects and scala-versions input
2 parents d0f4659 + 3e7096c commit 01793f4

File tree

31 files changed

+387
-336
lines changed

31 files changed

+387
-336
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ jobs:
6161
- run: npm version
6262
- run: npm install
6363
- run: npm run all
64-
- name: Run sbt-dependency-graph-action
64+
- name: Run sbt-dependency-submission
6565
uses: ./
6666
with:
67-
base-dir: sbt-plugin
68-
sbt-plugin-version: 1.2.0-SNAPSHOT
67+
working-directory: sbt-plugin
68+
6969

README.md

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sbt Dependency Graph Action
1+
# Sbt Dependency Submission
22

33
A Github action to submit the dependency graph of an [sbt](https://www.scala-sbt.org/) build to the Github [Dependency submission API](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api).
44

@@ -17,59 +17,46 @@ Create a Github Action file under `.github/workflows` containing the following d
1717

1818
```yml
1919
# .github/workflows/dependency-graph.yml
20-
name: Submit Dependency Graph
20+
name: Update Dependency Graph
2121
on:
2222
push:
2323
branches:
2424
- main # default branch of the project
2525
jobs:
26-
submit-graph:
27-
name: Submit Dependency Graph
26+
dependency-graph:
27+
name: Update Dependency Graph
2828
runs-on: ubuntu-latest # or windows-latest, or macOS-latest
2929
permissions:
3030
contents: write # this permission is needed to submit the dependency graph
3131
steps:
3232
- uses: actions/checkout@v3
33-
- uses: scalacenter/sbt-dependency-graph-action@v1
33+
- uses: scalacenter/sbt-dependency-submission@v1
3434
```
3535
3636
### Inputs
3737
38-
#### - `base-dir` (optional)
38+
#### - `working-directory` (optional)
3939

40-
The relative path of the base directory of your sbt build.
40+
The relative path of the working directory of your sbt build.
4141
Default value is `.`
4242

43-
#### - `projects` (optional)
43+
#### - `modules-ignore` (optional)
4444

45-
A list of space-separated names of projects from your build.
46-
The action will publish the graph of these projects only.
47-
48-
Example: `foo bar`
49-
50-
Default is empty string and it means all projects.
51-
52-
#### - `scala-versions` (optional)
53-
54-
A list of space-separated versions of Scala, that are declared in your build.
55-
The action will publish the graph on these Scala versions only.
56-
57-
Example: `2.13.8 3.1.3`
58-
59-
Default is empty string and it means all Scala versions.
45+
A list of space-separated names of modules to ignore. The action will not resolve nor submit the dependencies of these modules.
46+
The name of a module contains the name of the project and its binary version.
47+
Example: `foo_2.13 bar_2.13`
6048

6149
#### Example
6250

63-
In this example the snapshot will contain the graphs of `foo_2.13`, `foo_3`, `bar_2.13` and `bar_3`.
51+
In this example the snapshot will not contain the graphs of `foo_2.13` and `bar_3`.
6452

6553
```yaml
6654
steps:
6755
- uses: actions/checkout@v3
68-
- uses: scalacenter/sbt-dependency-[email protected]
56+
- uses: scalacenter/sbt-dependency-submission@v1
6957
with:
7058
base-dir: ./my-scala-project
71-
projects: foo bar
72-
scala-versions: 2.13.8 3.1.3
59+
projects: foo_2.13 bar_3
7360
```
7461

7562
## Troubleshooting

action.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1-
name: 'Sbt Dependency Graph Action'
1+
name: 'Sbt Dependency Submission'
22
description: 'Submits the dependency graph of an sbt build to the Github Submission API'
33
author: 'The Scala Center'
44
branding:
55
icon: 'package'
66
color: '#1a84ac'
77
inputs:
8-
base-dir:
9-
description: "The relative path of the base directory of the sbt build."
8+
working-directory:
9+
description: "The relative path of the working directory of the sbt build."
1010
required: false
1111
default: ''
12-
projects:
13-
description: "A list of space-separated names of projects from your build. The action will publish the graph of these projects only. If unspecified, the action will detect all the projects of the build."
12+
modules-ignore:
13+
description: |
14+
A list of space-separated names of modules to ignore. The action will not resolve nor submit the dependencies of these modules.
15+
The name of a module contains the name of the project and its binary version.
16+
Example: `foo_2.13 bar_2.13`
1417
required: false
1518
default: ''
16-
scala-versions:
17-
description: "A list of space-separated versions of Scala, that are declared in your build. The action will publish the graph on these Scala versions only. If unspecified, the action will detect all the Scala versions of the build."
19+
on-resolve-failure:
20+
description: |
21+
Either 'error' or 'warning'.
22+
When a dependency resolution failure happens, if 'error' the job will fail and will not submit the snapshot.
23+
If 'warning', the job will ignore the failing modules and submit the snapshot.
1824
required: false
19-
default: ''
25+
default: error
2026
token:
21-
description: "GitHub Personal Access Token (PAT). Defaults to PAT provided by Action runner."
27+
description: GitHub Personal Access Token (PAT). Defaults to PAT provided by Action runner.
2228
required: false
2329
default: ${{ github.token }}
24-
sbt-plugin-version:
25-
description: "Override the version of the sbt-github-dependency-graph plugin that is used internally."
26-
required: false
27-
default: ''
2830
runs:
2931
using: 'node16'
3032
main: 'dist/index.js'

dist/index.js

Lines changed: 19 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)