Skip to content

Commit 9295f8a

Browse files
committed
updates for example workflow
1 parent f85983a commit 9295f8a

File tree

3 files changed

+34
-19
lines changed

3 files changed

+34
-19
lines changed

content/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,51 @@ For more information about the Dependency submission API, see the [Dependency su
1616

1717
## Submitting dependencies at build-time
1818

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:
2020

2121
- generate a list of dependencies for your project.
2222
- 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).
2323
- submit the formatted list of dependencies to the Dependency submission API.
2424

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 %}.
2626

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
2828

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

32-
name: Submit dependencies
31+
```yaml
3332

33+
name: Go Dependency Submission
3434
on:
3535
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
3942
jobs:
40-
submit-dependencies:
43+
go-action-detection:
4144
runs-on: ubuntu-latest
4245
steps:
43-
- uses: anchore/sbom-action@bb716408e75840bbb01e839347cd213767269d4a
44-
with:
45-
image: ghcr.io/example/image_name:tag
46-
```
46+
- name: 'Checkout Repository'
47+
uses: actions/checkout@v3
48+
- uses: actions/setup-go@v3
49+
with:
50+
go-version: ">=1.18.0"
51+
- name: Run snapshot action
52+
uses: @dsp-testing/go-snapshot-action
53+
with:
54+
# 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
4763

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+
```
4965

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)".
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
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
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.
32

43
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.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% note %}
22

3-
**Note:** The Dependency submission API is currently in beta and subject to change
3+
**Note:** The Dependency submission API is currently in public beta and subject to change.
44

55
{% endnote %}

0 commit comments

Comments
 (0)