You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api.md
+32-16Lines changed: 32 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,35 +16,51 @@ For more information about the Dependency submission API, see the [Dependency su
16
16
17
17
## Submitting dependencies at build-time
18
18
19
-
You can use the Dependency submission API in a {% data variables.product.prodname_actions %} workflow to submit dependencies for your project when your project is built. You workflow should:
19
+
You can use the Dependency submission API in a {% data variables.product.prodname_actions %} workflow to submit dependencies for your project when your project is built. Your workflow should:
20
20
21
21
- generate a list of dependencies for your project.
22
22
- translate the list of dependencies into the format accepted by the Dependency submission API. For more information about the format, see the body parameters for the "Create a repository snapshot" API operation in the [Dependency submission REST API documentation](/rest/dependency-graph/dependency-submission).
23
23
- submit the formatted list of dependencies to the Dependency submission API.
24
24
25
-
Actions that perform these steps for various ecosystems are available on {% data variables.product.prodname_marketplace %}. todo link to them once available, or tell users how to find them.
25
+
Actions that perform these steps for various ecosystems are available on {% data variables.product.prodname_marketplace %}.
26
26
27
-
For example, this workflow uses the [anchore/sbom-action](https://github.com/marketplace/actions/anchore-sbom-action) action to submit dependencies . Todo change this to match whatever the starter workflow will use, and give more guidance if needed.
27
+
TODO add list/table of supported actions
28
28
29
-
```yaml
30
-
{% data reusables.actions.actions-not-certified-by-github-comment %}
29
+
For example, the following [Go Dependency Submission](https://github.com/dsp-testing/go-dependency-submission) workflow calculates the dependencies for a Go build-target (a Go file with a `main` function) and submits the list to the Dependency Submission API.
31
30
32
-
name: Submit dependencies
31
+
```yaml
33
32
33
+
name: Go Dependency Submission
34
34
on:
35
35
push:
36
-
branches:
37
-
- 'main'
38
-
36
+
branches:
37
+
- main
38
+
# Envionment variables to configure Go and Go modules. Customize as necessary
39
+
env:
40
+
GOPROXY: ''# A Go Proxy server to be used
41
+
GOPRIVATE: ''# A list of modules are considered private and not requested from GOPROXY
# Required: Define the repo path to the go.mod file used by the
55
+
# build target
56
+
go-mod-path: go-example/go.mod
57
+
#
58
+
# Define the repo path of a build target (a file with a
59
+
# `main()` function) If not defined, this Action will collect all
60
+
# dependencies used by all build targets for the module, which may
61
+
# include Go dependencies used by tests and tooling.
62
+
go-build-target: go-example/cmd/octocat.go
47
63
48
-
Alternatively, you can write your own action to perform these steps. {% data variables.product.product_name %} maintains the [Dependency Submission Toolkit](https://github.com/github/dependency-submission-toolkit), a TypeScript library to help you write an action to perform these steps. For more information about writing an action, see "[Creating actions](/actions/creating-actions)". todo ensure that this repo will be public, or else delete this link. todo is "maintains" too strong a word?
64
+
```
49
65
50
-
todo link to starter workflows once available
66
+
Alternatively, you can write your own action to perform these steps. {% data variables.product.product_name %} maintains the [Dependency Submission Toolkit](https://github.com/github/dependency-submission-toolkit), a TypeScript library to help you build your own GitHub Action for submitting dependencies to the Dependency Submission API. For more information about writing an action, see "[Creating actions](/actions/creating-actions)".
The Dependency submission API lets you submit dependencies for a project to generate a dependency graph. This enables you to generate a dependency graph for projects
2
-
that resolve dependencies when the software is built or compiled. For more information about viewing the dependency graph, see "[Exploring the dependencies of a repository](/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository#viewing-the-dependency-graph)." Submitted dependencies will receive {% data variables.product.prodname_dependabot_alerts %} and {% data variables.product.prodname_dependabot_security_updates %} for any known vulnerabilities.
1
+
The Dependency submission API lets you submit dependencies for a project to generate a dependency graph. This enables you to generate a dependency graph for projects that resolve dependencies when the software is built or compiled. For more information about viewing the dependency graph, see "[Exploring the dependencies of a repository](/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository#viewing-the-dependency-graph)." Submitted dependencies will receive {% data variables.product.prodname_dependabot_alerts %} and {% data variables.product.prodname_dependabot_security_updates %} for any known vulnerabilities.
3
2
4
3
Projects that declare their dependencies in a file that is committed to the repository (for example, a `package-lock.json` file in a JavaScript project) do not need to use the Dependency submission API in order to generate a dependency graph. However, these projects can still use the Dependency submission API.
0 commit comments