Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ jobs:
- run: npm version
- run: npm install
- run: npm run all
- name: Run sbt-dependency-graph-action
- name: Run sbt-dependency-submission
uses: ./
with:
base-dir: sbt-plugin
sbt-plugin-version: 1.2.0-SNAPSHOT
working-directory: sbt-plugin


41 changes: 14 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sbt Dependency Graph Action
# Sbt Dependency Submission

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).

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

```yml
# .github/workflows/dependency-graph.yml
name: Submit Dependency Graph
name: Update Dependency Graph
on:
push:
branches:
- main # default branch of the project
jobs:
submit-graph:
name: Submit Dependency Graph
dependency-graph:
name: Update Dependency Graph
runs-on: ubuntu-latest # or windows-latest, or macOS-latest
permissions:
contents: write # this permission is needed to submit the dependency graph
steps:
- uses: actions/checkout@v3
- uses: scalacenter/sbt-dependency-graph-action@v1
- uses: scalacenter/sbt-dependency-submission@v1
```

### Inputs

#### - `base-dir` (optional)
#### - `working-directory` (optional)

The relative path of the base directory of your sbt build.
The relative path of the working directory of your sbt build.
Default value is `.`

#### - `projects` (optional)
#### - `modules-ignore` (optional)

A list of space-separated names of projects from your build.
The action will publish the graph of these projects only.

Example: `foo bar`

Default is empty string and it means all projects.

#### - `scala-versions` (optional)

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.

Example: `2.13.8 3.1.3`

Default is empty string and it means all Scala versions.
A list of space-separated names of modules to ignore. The action will not resolve nor submit the dependencies of these modules.
The name of a module contains the name of the project and its binary version.
Example: `foo_2.13 bar_2.13`

#### Example

In this example the snapshot will contain the graphs of `foo_2.13`, `foo_3`, `bar_2.13` and `bar_3`.
In this example the snapshot will not contain the graphs of `foo_2.13` and `bar_3`.

```yaml
steps:
- uses: actions/checkout@v3
- uses: scalacenter/sbt-dependency-[email protected]
- uses: scalacenter/sbt-dependency-submission@v1
with:
base-dir: ./my-scala-project
projects: foo bar
scala-versions: 2.13.8 3.1.3
projects: foo_2.13 bar_3
```

## Troubleshooting
Expand Down
28 changes: 15 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
name: 'Sbt Dependency Graph Action'
name: 'Sbt Dependency Submission'
description: 'Submits the dependency graph of an sbt build to the Github Submission API'
author: 'The Scala Center'
branding:
icon: 'package'
color: '#1a84ac'
inputs:
base-dir:
description: "The relative path of the base directory of the sbt build."
working-directory:
description: "The relative path of the working directory of the sbt build."
required: false
default: ''
projects:
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."
modules-ignore:
description: |
A list of space-separated names of modules to ignore. The action will not resolve nor submit the dependencies of these modules.
The name of a module contains the name of the project and its binary version.
Example: `foo_2.13 bar_2.13`
required: false
default: ''
scala-versions:
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."
on-resolve-failure:
description: |
Either 'error' or 'warning'.
When a dependency resolution failure happens, if 'error' the job will fail and will not submit the snapshot.
If 'warning', the job will ignore the failing modules and submit the snapshot.
required: false
default: ''
default: error
token:
description: "GitHub Personal Access Token (PAT). Defaults to PAT provided by Action runner."
description: GitHub Personal Access Token (PAT). Defaults to PAT provided by Action runner.
required: false
default: ${{ github.token }}
sbt-plugin-version:
description: "Override the version of the sbt-github-dependency-graph plugin that is used internally."
required: false
default: ''
runs:
using: 'node16'
main: 'dist/index.js'
40 changes: 19 additions & 21 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading