66 Commits
v2.0.1 ... main

Author SHA1 Message Date
Lewis Jones
00fe44a873 Merge pull request #103 from actions/ljones140/security-upgrades
Some checks failed
Go Dependency Submission / go-action-detection (push) Has been cancelled
build-test / build (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Security Upgrade
2026-04-22 11:46:41 +01:00
Lewis Jones
f00e6e9196 generated dist 2026-04-20 15:29:48 +01:00
Lewis Jones
af797f9868 Upgrade dependencies
- @actions/core: ^1.9.1 → ^1.11.1 (minor bump within v1)
- @actions/github: ^6.0.0 → ^6.0.1 (patch bump within v6)
- Added "overrides": { "undici": "^6.24.0" } to force undici past the vulnerable range
2026-04-20 15:29:12 +01:00
Barry Gordon
72c2bf7f19 Merge pull request #95 from actions/dependabot/npm_and_yarn/js-yaml-3.14.2
Bump js-yaml from 3.14.1 to 3.14.2
2025-11-24 13:51:11 +00:00
dependabot[bot]
235fcc6594 Bump js-yaml from 3.14.1 to 3.14.2
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 3.14.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...3.14.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 3.14.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 21:54:46 +00:00
Lewis Jones
9b61b9485b Merge pull request #91 from salmanmkc/node24
Update Node and GitHub Actions versions to latest
2025-09-01 17:32:10 +01:00
Lewis Jones
7c50a64c44 Merge branch 'main' into node24 2025-09-01 17:24:31 +01:00
Ashely Tenesaca
d9b9b1fa96 Merge pull request #93 from actions/AshelyTC-patch-1
Add permissions to .github/workflows/test.yml
2025-08-19 14:30:14 -04:00
Ashely Tenesaca
0bd5fe6328 Add permissions to .github/workflows/test.yml 2025-08-19 12:48:03 -04:00
Ashely Tenesaca
b9bf40984f Merge pull request #92 from actions/AshelyTC-patch-1
Add actions and go to CodeQL analysis languages
2025-08-18 16:32:47 -04:00
Ashely Tenesaca
703616f176 Add 'actions' and 'go' to CodeQL analysis languages 2025-08-18 16:05:44 -04:00
Salman Muin Kayser Chishti
6fe75f51e7 Update Node and GitHub Actions versions to latest
Bump Node.js engine requirement to >=24 in package.json and package-lock.json. Update action.yml to use node24. Upgrade actions/checkout to v4 and actions/setup-go to v5 in the workflow. These changes ensure compatibility with the latest Node.js and GitHub Actions tooling.
2025-07-30 14:07:24 +01:00
Ahmed ElMallah
dacf4810ac Merge pull request #86 from actions/dependabot/npm_and_yarn/undici-5.29.0
Bump undici from 5.28.5 to 5.29.0
2025-06-20 13:19:33 -04:00
ahmed3lmallah
91df78fe21 updating dist 2025-06-20 12:20:09 -04:00
Ahmed ElMallah
55972e19aa Merge branch 'main' into dependabot/npm_and_yarn/undici-5.29.0 2025-06-20 12:06:48 -04:00
Lewis Jones
9750009dfa Merge pull request #88 from actions/ljones140/example-for-private-go-modules
Add documentation to authenticate to private go modules
2025-06-06 15:39:47 +01:00
Lewis Jones
48c3878c0b Apply suggestion from @elrayle
Co-authored-by: E. Lynette Rayle <elrayle@users.noreply.github.com>
2025-06-06 15:36:25 +01:00
Lewis Jones
3f1029a8a5 Add documentation of how to authenticate to private go modules 2025-06-04 14:39:22 +01:00
E. Lynette Rayle
5cde65f6ad Merge pull request #87 from actions/elr/inputs
add inputs used by autosubmission
2025-05-29 22:08:57 -04:00
E. Lynette Rayle
1600567d42 update dist from rebuild 2025-05-29 19:24:36 +00:00
E. Lynette Rayle
888b4d0158 improve comments about the sha and ref inputs 2025-05-29 19:23:09 +00:00
E. Lynette Rayle
6df4cede7a improve detector comment and provide defaults 2025-05-29 19:13:21 +00:00
E. Lynette Rayle
9c1ae0dcfb update rebuilt dist 2025-05-29 19:05:40 +00:00
E. Lynette Rayle
aa37531e2b make sure sha and ref are only overwritten if a value was passed in 2025-05-29 19:01:50 +00:00
E. Lynette Rayle
ced71b5163 add updated files from rebuilding 2025-05-29 15:31:31 +00:00
E. Lynette Rayle
a493d67921 revert to directly using input for sha and ref and allowing the context to drive them if they are missing 2025-05-29 15:27:47 +00:00
E. Lynette Rayle
7bdee92e05 don't indent shell: bash 2025-05-28 22:34:32 +00:00
E. Lynette Rayle
8826bd4af6 make the uncommitted files message easier to understand 2025-05-28 22:30:43 +00:00
E. Lynette Rayle
343ae9cc50 add results from rebuilding 2025-05-28 22:18:35 +00:00
E. Lynette Rayle
4d284b90be commit files generated during build 2025-05-28 20:45:18 +00:00
E. Lynette Rayle
50fef6cb9b doh - drop the echo to run the command 2025-05-28 20:29:09 +00:00
E. Lynette Rayle
3d515f5ff4 Show the results of the check in step Verify no unommitted files 2025-05-28 20:23:32 +00:00
E. Lynette Rayle
3a3b0da726 set default for sha & ref 2025-05-28 18:30:40 +00:00
E. Lynette Rayle
3e507a8464 use reasonable defaults for sha and ref
enforce all detector vars present or not present
2025-05-28 18:21:20 +00:00
E. Lynette Rayle
f3f97c6024 add inputs used by autosubmission 2025-05-27 22:02:13 +00:00
dependabot[bot]
4bd7d52f51 Bump undici from 5.28.5 to 5.29.0
Bumps [undici](https://github.com/nodejs/undici) from 5.28.5 to 5.29.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.5...v5.29.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 5.29.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-15 16:34:10 +00:00
Kevin Dangoor
f35d5c9af1 Merge pull request #85 from actions/release-2.0.3
Bump version to 2.0.3
2025-03-26 11:28:24 -04:00
Kevin Dangoor
8454e68228 Bump version to 2.0.3 2025-03-26 11:26:53 -04:00
Kevin Dangoor
f4fbdfe68d Merge pull request #84 from actions/dangoor/update-octokit-request
Bump @octokit/request to 8.4.1
2025-03-25 19:06:59 -04:00
Kevin Dangoor
09a4b01601 Bump dist files again 2025-03-25 18:43:46 -04:00
Kevin Dangoor
3e2296c031 Update build 2025-03-25 18:35:19 -04:00
Kevin Dangoor
9d7f10abd3 Bump @octokit/request to 8.4.1
Stopgap until dependencies are also updated to use this version.
2025-03-25 18:25:21 -04:00
Kevin Dangoor
d08b6a6501 Merge pull request #83 from actions/2.0.2-release
Bump version to 2.0.2
2025-03-24 18:16:27 -04:00
Kevin Dangoor
4bebd21824 Update CONTRIBUTING.md
Co-authored-by: Justin Holguín <juxtin@github.com>
2025-03-24 18:06:31 -04:00
Kevin Dangoor
e9e2e59767 Bump version to 2.0.2
Also updates the CONTRIBUTING.md doc to include the release process.
2025-03-24 17:55:11 -04:00
Justin Holguín
181154c17c Merge pull request #82 from actions/justin/update-toolkit
Update dependency-submission-toolkit to 2.0.5
2025-03-24 14:48:54 -07:00
Kevin Dangoor
6a5c1e1928 Update distribution files 2025-03-24 17:35:50 -04:00
Kevin Dangoor
4581c519ef Need to allow dependencies to be transformed for Jest 2025-03-24 17:32:22 -04:00
Kevin Dangoor
4dd248e6c8 Set Babel up for node 20 2025-03-24 17:11:39 -04:00
Kevin Dangoor
2ba7333c02 Add @babel/preset-typescript to enable TS support 2025-03-24 16:18:13 -04:00
Kevin Dangoor
bd5ddec6ab More Babel TypeScript config for Jest 2025-03-24 16:13:49 -04:00
Justin Holguín
6b820c79e5 Add babel 2025-03-21 21:00:28 +00:00
Justin Holguín
5aac9f3ac2 Update dependency-submission-toolkit to 2.0.5 2025-03-21 20:45:01 +00:00
Justin Holguín
745f5239f5 Merge pull request #81 from actions/dependabot/npm_and_yarn/octokit/plugin-paginate-rest-9.2.2
Bump @octokit/plugin-paginate-rest from 9.2.1 to 9.2.2
2025-03-18 12:02:05 -07:00
Justin Holguín
85b60b73f4 Update dist files 2025-03-18 18:51:11 +00:00
dependabot[bot]
09f927f752 Bump @octokit/plugin-paginate-rest from 9.2.1 to 9.2.2
Bumps [@octokit/plugin-paginate-rest](https://github.com/octokit/plugin-paginate-rest.js) from 9.2.1 to 9.2.2.
- [Release notes](https://github.com/octokit/plugin-paginate-rest.js/releases)
- [Commits](https://github.com/octokit/plugin-paginate-rest.js/compare/v9.2.1...v9.2.2)

---
updated-dependencies:
- dependency-name: "@octokit/plugin-paginate-rest"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 23:32:23 +00:00
Justin Holguín
c5cb11e009 Merge pull request #79 from actions/dependabot/npm_and_yarn/multi-cd076efa13
Bump @octokit/request-error, @actions/github and @github/dependency-submission-toolkit
2025-03-17 16:18:55 -07:00
Justin Holguín
46e428f958 Let prettier/rebuild do its thing 2025-03-17 21:43:12 +00:00
Justin Holguín
edddf01ef3 Add prettier as an explicit dev dependency 2025-03-17 21:41:33 +00:00
dependabot[bot]
fef74437e1 Bump @octokit/request-error, @actions/github and @github/dependency-submission-toolkit
Bumps [@octokit/request-error](https://github.com/octokit/request-error.js) to 5.1.1 and updates ancestor dependencies [@octokit/request-error](https://github.com/octokit/request-error.js), [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) and [@github/dependency-submission-toolkit](https://github.com/github/dependency-submission-toolkit). These dependencies need to be updated together.


Updates `@octokit/request-error` from 2.1.0 to 5.1.1
- [Release notes](https://github.com/octokit/request-error.js/releases)
- [Commits](https://github.com/octokit/request-error.js/compare/v2.1.0...v5.1.1)

Updates `@actions/github` from 5.0.3 to 6.0.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github)

Updates `@github/dependency-submission-toolkit` from 1.2.10 to 2.0.4
- [Release notes](https://github.com/github/dependency-submission-toolkit/releases)
- [Commits](https://github.com/github/dependency-submission-toolkit/compare/v1.2.10...v2.0.4)

---
updated-dependencies:
- dependency-name: "@octokit/request-error"
  dependency-type: indirect
- dependency-name: "@actions/github"
  dependency-type: direct:production
- dependency-name: "@github/dependency-submission-toolkit"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-14 23:38:40 +00:00
Ahmed ElMallah
96669416e3 Merge pull request #78 from actions/dependabot/npm_and_yarn/undici-5.28.5
Bump undici from 5.28.4 to 5.28.5
2025-01-23 12:34:24 -08:00
dependabot[bot]
524f7d80b6 Bump undici from 5.28.4 to 5.28.5
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.28.5.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.28.5)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-21 23:57:53 +00:00
Justin Holguín
105f29a556 Merge pull request #73 from actions/dependabot/npm_and_yarn/braces-3.0.3
Bump braces from 3.0.2 to 3.0.3
2024-07-08 14:56:44 -07:00
dependabot[bot]
57a7494bef Bump braces from 3.0.2 to 3.0.3
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-19 22:09:37 +00:00
Eli Reisman
b602dbb43a Merge pull request #72 from actions/dependabot/npm_and_yarn/undici-5.28.4
Bump undici from 5.28.3 to 5.28.4
2024-06-04 14:39:09 -07:00
dependabot[bot]
59b9adda7a Bump undici from 5.28.3 to 5.28.4
Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.3...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-04 17:16:42 +00:00
14 changed files with 35976 additions and 18859 deletions

View File

@@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript' ]
language: [ 'javascript-typescript', 'actions', 'go' ]
steps:
- name: Checkout repository

View File

@@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ">=1.18.0"

View File

@@ -8,7 +8,10 @@ on: # rebuild any PRs and main branch changes
branches:
- main
- 'releases/*'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
@@ -28,5 +31,10 @@ jobs:
run: npm rebuild && npm run all
- name: Verify no uncommitted files
run: '[ -z "$(git status --porcelain=v1 2>/dev/null)" ]'
run: |
if [ -n "$(git status --porcelain=v1 2>/dev/null)" ]; then
echo "There are uncommitted changes!"
git status --porcelain=v1
exit 1
fi
shell: bash

View File

@@ -28,6 +28,46 @@ Here are a few things you can do that will increase the likelihood of your pull
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
## Cutting a new release
<details>
_Note: these instructions are for maintainers_
1. Update the version number in [package.json](https://github.com/actions/go-dependency-submission/blob/main/package.json) and run `npm i` to update the lockfile.
1. Go to [Draft a new
release](https://github.com/actions/go-dependency-submission/releases/new)
in the Releases page.
1. Make sure that the `Publish this Action to the GitHub Marketplace`
checkbox is enabled
<img width="481" alt="Screenshot 2022-06-15 at 12 08 19" src="https://user-images.githubusercontent.com/2161/173822484-4b60d8b4-c674-4bff-b5ff-b0c4a3650ab7.png">
3. Click "Choose a tag" and then "Create new tag", where the tag name
will be your version prefixed by a `v` (e.g. `v1.2.3`).
4. Use a version number for the release title (e.g. "1.2.3").
<img width="700" alt="Screenshot 2022-06-15 at 12 08 36" src="https://user-images.githubusercontent.com/2161/173822548-33ab3432-d679-4dc1-adf8-b50fdaf47de3.png">
5. Add your release notes. If this is a major version make sure to
include a small description of the biggest changes in the new version.
6. Click "Publish Release".
You now have a tag and release using the semver version you used
above. The last remaining thing to do is to move the dynamic version
identifier to match the current SHA. This allows users to adopt a
major version number (e.g. `v1`) in their workflows while
automatically getting all the
minor/patch updates.
To do this just checkout `main`, force-create a new annotated tag, and push it:
```
git tag -fa v2 -m "Updating v2 to 2.0.1"
git push origin v2 --force
```
</details>
## Resources
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)

View File

@@ -1,7 +1,7 @@
# Go Dependency Submission
This GitHub Action calculates dependencies for a Go build-target (a Go file with a
`main` function) and submits the list to the [Dependency submission API](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api). Dependencies then appear in your repository's dependency graph, and you'll receive Dependabot alerts and updates for vulnerable or out-of-date dependencies.
`main` function) and submits the list to the [Dependency submission API](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api). Dependencies then appear in your repository's dependency graph, and you'll receive Dependabot alerts and updates for vulnerable or out-of-date dependencies.
### Running locally
@@ -53,3 +53,81 @@ jobs:
# include Go dependencies used by tests and tooling.
go-build-target: go-example/cmd/octocat.go
```
### Accessing Private Go Modules
This action will fail if your `go.mod` contains private Go modules.
To access private Go modules the action requires an extra step to access your
private module registry.
See official Go documentation for more information at https://go.dev/doc/faq#git_https
#### Accessing Private Go Modules Hosted on GitHub
If your private Go modules are hosted on GitHub, there are various ways for the action to
access them. You can use either HTTPS authentication with a Personal Access Token (PAT) or SSH authentication with deploy keys or SSH keys.
#### Authentication Methods
**HTTPS with Personal Access Token**: Uses a GitHub Personal Access Token to authenticate with private repositories. This method requires storing the token as a repository secret. See [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) for setup instructions.
**SSH Authentication**: Uses SSH keys or deploy keys for authentication. This method doesn't require storing tokens and can be more secure for some use cases. See the [GitHub documentation on SSH authentication](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) for setup instructions.
#### Additional Environment Variables
- **`GONOPROXY`**: Set this to bypass the module proxy entirely for specific modules
- **`GOSUMDB`**: Set to `off` or configure to skip checksum verification for private modules
- **`GOPROXY`**: Can be set to `direct` to bypass proxies completely
#### Example: HTTPS Authentication with Personal Access Token
This example adds a step to the workflow which uses a GitHub
[Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
which has repo permissions. The PAT is saved as a repo [actions secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions) `GH_ACCESS_TOKEN`.
The env variable `GOPRIVATE` has also been set so that the GitHub org `foo` is considered private.
```yaml
name: Go Dependency Submission
on:
push:
branches:
- main
# The API requires write permission on the repository to submit dependencies
permissions:
contents: write
# Environment variables to configure Go and Go modules. Customize as necessary
env:
GOPROXY: 'https://proxy.golang.org,direct' # To add a private proxy, place it between the public golang proxy and direct
GOPRIVATE: 'github.com/foo/*' # repositories in organization foo are considered private
jobs:
go-action-detection:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ">=1.18.0"
# Authentication step
- name: Authenticate with GitHub
run: git config --global url.https://${{ secrets.GH_ACCESS_TOKEN }}@github.com/.insteadOf https://github.com/
- name: Run snapshot action
uses: actions/go-dependency-submission@v2
with:
# Required: Define the repo path to the go.mod file used by the
# build target
go-mod-path: go-example/go.mod
#
# Optional: Define the path of a build target (a file with a
# `main()` function) If not defined, this Action will collect all
# dependencies used by all build targets for the module, which may
# include Go dependencies used by tests and tooling.
go-build-target: go-example/cmd/octocat.go
```

View File

@@ -17,6 +17,34 @@ inputs:
required: true
description: 'Build target to detect build dependencies. If unspecified, will use "all", with will detect all dependencies used in all build targets (including tests and tools).'
default: 'all'
snapshot-sha:
description: The SHA that the results will be linked to in the dependency snapshot
type: string
required: false
default: ''
snapshot-ref:
description: The ref that the results will be linked to in the dependency snapshot
type: string
required: false
default: ''
# If any of detector-name, detector-version, or detector-url are provided, they all have to be provided.
# Defaults will be used if none are not provided. If only one or two are provided, the action will fail.
detector-name:
description: The name of the detector that generated the dependency snapshot
type: string
required: false
default: ''
detector-version:
description: The version of the detector that generated the dependency snapshot
type: string
required: false
default: ''
detector-url:
description: The URL to the detector that generated the dependency snapshot
type: string
required: false
default: ''
runs:
using: 'node20'
using: 'node24'
main: 'dist/index.js'

6
babel.config.js Normal file
View File

@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: '20' } }],
'@babel/preset-typescript',
],
};

47382
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

160
dist/licenses.txt generated vendored
View File

@@ -268,16 +268,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@vercel/ncc
MIT
Copyright 2018 ZEIT, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
before-after-hook
Apache-2.0
Apache License
@@ -502,57 +492,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
is-plain-object
MIT
The MIT License (MIT)
Copyright (c) 2014-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
node-fetch
MIT
The MIT License (MIT)
Copyright (c) 2016 David Frank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
once
ISC
The ISC License
@@ -574,9 +513,25 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
packageurl-js
MIT
Copyright (c) the purl authors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
tr46
MIT
tunnel
MIT
@@ -603,6 +558,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
undici
MIT
MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
universal-user-agent
ISC
# [ISC License](https://spdx.org/licenses/ISC)
@@ -614,60 +594,6 @@ Permission to use, copy, modify, and/or distribute this software for any purpose
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
uuid
MIT
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
webidl-conversions
BSD-2-Clause
# The BSD 2-Clause License
Copyright (c) 2014, Domenic Denicola
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
whatwg-url
MIT
The MIT License (MIT)
Copyright (c) 20152016 Sebastian Mayr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
wrappy
ISC
The ISC License

View File

@@ -1,5 +1,11 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': 'babel-jest',
},
testEnvironment: 'node',
};
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
transformIgnorePatterns: [
'/node_modules/(?!@octokit|@github)',
],
};

7020
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,15 @@
{
"name": "go-dependency-submission",
"version": "2.0.1",
"version": "2.0.3",
"description": "Go Dependency Submission",
"main": "dist/index.js",
"engines": {
"node": ">=24"
},
"scripts": {
"build": "tsc",
"format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'",
"format": "npx prettier --write '**/*.ts'",
"format-check": "npx prettier --check '**/*.ts'",
"lint": "eslint --fix src/**/*.ts",
"package": "ncc build --source-map --license licenses.txt",
"test": "jest --testTimeout=10000",
@@ -25,25 +28,32 @@
},
"homepage": "https://github.com/actions/go-dependency-submission#readme",
"devDependencies": {
"@babel/core": "^7.26.10",
"@babel/preset-env": "^7.26.9",
"@babel/preset-typescript": "^7.27.0",
"@types/jest": "^27.5.2",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@vercel/ncc": "^0.33.4",
"babel-jest": "^29.7.0",
"eslint": "^8.13.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-n": "^15.1.0",
"eslint-plugin-promise": "^6.0.0",
"jest": "^28.0.0",
"ts-jest": "^28.0.4",
"prettier": "^3.5.3",
"ts-jest": "^29.0.0",
"typescript": "^4.6.4"
},
"dependencies": {
"@actions/core": "^1.9.1",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.0.3",
"@github/dependency-submission-toolkit": "^1.2.10",
"@actions/github": "^6.0.1",
"@github/dependency-submission-toolkit": "^2.0.5",
"packageurl-js": "^0.0.6"
},
"overrides": {
"undici": "^6.24.0"
}
}

View File

@@ -77,19 +77,62 @@ async function main () {
manifest.addIndirectDependency(dep)
})
const snapshot = new Snapshot(
{
type SnapshotDetector = {
name: string
url: string
version: string
}
let snapshotDetector: SnapshotDetector
const detectorName = core.getInput('detector-name')
const detectorUrl = core.getInput('detector-url')
const detectorVersion = core.getInput('detector-version')
if (detectorName === '' && detectorUrl === '' && detectorVersion === '') {
// use defaults if none are specified
snapshotDetector = {
name: 'actions/go-dependency-submission',
url: 'https://github.com/actions/go-dependency-submission',
version: '0.0.1'
},
github.context,
{
correlator: `${github.context.job}-${goBuildTarget}`,
id: github.context.runId.toString()
}
)
} else if (
detectorName === '' ||
detectorUrl === '' ||
detectorVersion === ''
) {
// if any of detectorName, detectorUrl, or detectorVersion have value, then they are all required
throw new Error(
"Invalid input: if any of 'detector-name', 'detector-url', or 'detector-version' have value, then thay are all required."
)
} else {
// use inputs since all are specified
snapshotDetector = {
name: detectorName,
url: core.getInput('detector-url', { required: true }),
version: core.getInput('detector-version', { required: true })
}
}
const snapshot = new Snapshot(snapshotDetector, github.context, {
correlator: `${github.context.job}-${goBuildTarget}`,
id: github.context.runId.toString()
})
snapshot.addManifest(manifest)
// only override the sha if the input has a value
// otherwise, continue to use the sha set from the context in the Snapshot constructor
const inputSHA = core.getInput('sha')
if (inputSHA !== '') {
snapshot.sha = inputSHA
}
// only override the ref if the input has a value
// otherwise, continue to use the ref set from the context in the Snapshot constructor
const inputRef = core.getInput('ref')
if (inputRef !== '') {
snapshot.ref = inputRef
}
submitSnapshot(snapshot)
}