119 Commits

Author SHA1 Message Date
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
Federico Builes
a9f822c0ea Merge pull request #71 from actions/bump-version
Prepare version for a new release
2024-02-19 16:10:08 +01:00
Federico Builes
5223bcc5d4 bumping to 2.0.1 2024-02-19 09:47:06 +01:00
Federico Builes
8d0ce81957 Merge pull request #70 from actions/dependabot/npm_and_yarn/undici-5.28.3
Bump undici from 5.26.3 to 5.28.3
2024-02-18 11:32:00 +01:00
dependabot[bot]
8d6b550076 Bump undici from 5.26.3 to 5.28.3
Bumps [undici](https://github.com/nodejs/undici) from 5.26.3 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.26.3...v5.28.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-16 17:56:57 +00:00
Justin Holguín
b796b3ebd8 Merge pull request #68 from actions/juxtin/custom-codeql-config
Use custom config for CodeQL
2024-02-01 16:16:06 -08:00
Justin Holguín
8510578b7e Use custom config for CodeQL 2024-02-01 16:01:04 -08:00
Federico Builes
1db3859355 Updating README. 2024-01-10 19:31:52 +01:00
Federico Builes
9aded48345 Merge pull request #67 from takost/update-version
Update version of the action
2024-01-10 19:24:16 +01:00
Tatyana Kostromskaya
2cf691415a . 2024-01-10 14:06:12 +00:00
Tatyana Kostromskaya
1f44486d0f Rebuild index.js 2024-01-10 14:01:20 +00:00
Tatyana Kostromskaya
48da37c7b0 Update version 2024-01-10 13:51:15 +00:00
Federico Builes
b06941e7bf Merge pull request #66 from takost/update-to-node-20
Update action to node20
2023-12-01 17:47:25 +01:00
Tatyana Kostromskaya
112d372804 Add --forceExit for jest 2023-11-29 15:52:57 +00:00
Tatyana Kostromskaya
5e5b8b9d64 Merge branch 'actions:update-to-node-20' into update-to-node-20 2023-11-29 16:51:33 +01:00
Tatyana Kostromskaya
c610a9900d Update dist 2023-11-29 15:40:25 +00:00
Federico Builes
e7076bab0b adding dist 2023-11-16 18:00:26 +01:00
Tatyana Kostromskaya
d91a3027e6 Update action to node20 2023-11-16 16:13:23 +00:00
Federico Builes
5d45e10560 Merge pull request #65 from gwynne/patch-1
Fix safe harbor policy link
2023-10-18 19:18:28 +02:00
Gwynne Raskind
d2676f9634 Fix safe harbor policy link 2023-10-18 10:37:53 -05:00
Federico Builes
0d0291b693 Merge pull request #64 from actions/dependabot/npm_and_yarn/babel/traverse-7.23.2
Bump @babel/traverse from 7.17.10 to 7.23.2
2023-10-17 06:21:27 +02:00
dependabot[bot]
1f1e6536fd Bump @babel/traverse from 7.17.10 to 7.23.2
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.10 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 04:03:25 +00:00
Federico Builes
a6640f43bd Merge pull request #63 from actions/dependabot/npm_and_yarn/undici-5.26.3
Bump undici from 5.19.1 to 5.26.3
2023-10-17 06:02:22 +02:00
dependabot[bot]
b423ed5efd Bump undici from 5.19.1 to 5.26.3
Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.19.1...v5.26.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 15:14:06 +00:00
Federico Builes
880440424e Merge pull request #58 from actions/dependabot/npm_and_yarn/word-wrap-1.2.4
Bump word-wrap from 1.2.3 to 1.2.4
2023-07-21 11:59:33 +02:00
dependabot[bot]
4897662a1b Bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 17:27:34 +00:00
cnagadya
5c34c91057 Merge pull request #54 from actions/cnagadya-patch-1
Correct action repo owner
2023-05-31 11:39:32 +02:00
cnagadya
32d7c023d7 Correct action repo 2023-05-31 11:28:29 +02:00
Justin Holguín
1694cb9629 Merge pull request #47 from actions/juxtin/update-dep-sub-toolkit
Update dependency-submission-toolkit
2023-03-23 08:34:28 -07:00
Justin Holguín
d7966ef64e Update dependency-submission-toolkit 2023-03-22 23:35:52 +00:00
Federico Builes
998688d177 Merge pull request #42 from actions/dependabot/go_modules/go-example/golang.org/x/sys-0.1.0
Bump golang.org/x/sys from 0.0.0-20210630005230-0f9fa26af87c to 0.1.0 in /go-example
2023-02-27 08:06:57 +01:00
dependabot[bot]
cdfd7f9b91 Bump golang.org/x/sys in /go-example
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.0.0-20210630005230-0f9fa26af87c to 0.1.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-25 09:18:50 +00:00
Federico Builes
12ed0c79c3 Merge pull request #39 from actions/dependabot/npm_and_yarn/json5-1.0.2
Bump json5 from 1.0.1 to 1.0.2
2023-02-17 07:46:48 +01:00
dependabot[bot]
fd87e17f94 Bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-17 05:46:28 +00:00
Federico Builes
d4b57fec94 Merge pull request #41 from actions/dependabot/npm_and_yarn/undici-5.19.1
Bump undici from 5.9.1 to 5.19.1
2023-02-17 06:25:15 +01:00
dependabot[bot]
78efaf639c Bump undici from 5.9.1 to 5.19.1
Bumps [undici](https://github.com/nodejs/undici) from 5.9.1 to 5.19.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.9.1...v5.19.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-17 00:09:43 +00:00
Federico Builes
d37c65d5a9 Merge pull request #36 from JamesMGreene/patch-1
Update to latest `actions/publish-action`
2022-11-22 18:02:49 +01:00
James M. Greene
728761be7d Update to latest actions/publish-action
To avoid Actions core deprecation messages.

https://github.com/actions/publish-action/releases/tag/v0.2.1
2022-11-22 10:29:50 -06:00
Justin Holguín
453d260096 Merge pull request #31 from juxtin/juxtin/add-release-tagging-action
Add publish-action to sync major release tags to latest minor
2022-08-24 10:07:42 -07:00
Justin Holguín
7e724ef87d Add publish-action to sync major release tags to latest minor 2022-08-23 22:54:32 +00:00
Federico Builes
eff7249d2b Merge pull request #28 from actions/dependabot/npm_and_yarn/actions/core-1.9.1
Bump @actions/core from 1.8.2 to 1.9.1
2022-08-19 11:59:15 +02:00
Federico Builes
5fa7223a28 Merge branch 'main' into dependabot/npm_and_yarn/actions/core-1.9.1 2022-08-19 11:58:09 +02:00
Federico Builes
c25e12f595 adding dist folder 2022-08-19 11:57:44 +02:00
Federico Builes
499f61e5cd Merge pull request #30 from jhutchings1/patch-1
Add default value for go-mod-path
2022-08-19 11:51:26 +02:00
Federico Builes
e309b61d86 Merge branch 'main' into patch-1 2022-08-19 11:47:31 +02:00
dependabot[bot]
ef79eb4942 Bump @actions/core from 1.8.2 to 1.9.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.8.2 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-19 07:58:44 +00:00
Federico Builes
c59a403029 Merge pull request #29 from actions/dependabot/npm_and_yarn/undici-5.9.1
Bump undici from 5.8.0 to 5.9.1
2022-08-19 09:58:05 +02:00
Justin Hutchings
cb1da62126 Add default value for go-mod-path 2022-08-18 16:55:46 -07:00
dependabot[bot]
67952530be Bump undici from 5.8.0 to 5.9.1
Bumps [undici](https://github.com/nodejs/undici) from 5.8.0 to 5.9.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.8.0...v5.9.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-18 20:01:31 +00:00
Lane Seppala
e1c1302788 Merge pull request #25 from actions/dependabot/npm_and_yarn/undici-5.8.0
Bump undici from 5.5.1 to 5.8.0
2022-07-22 09:49:25 -06:00
dependabot[bot]
d101b09c67 Bump undici from 5.5.1 to 5.8.0
Bumps [undici](https://github.com/nodejs/undici) from 5.5.1 to 5.8.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.5.1...v5.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 21:01:02 +00:00
Henri Maurer
009ad91f14 Merge pull request #22 from actions/hmaurer-patch-1
Remove instructions to login to GPR
2022-06-29 11:27:05 +01:00
Henri Maurer
0fa2b3c388 Update README.md 2022-06-29 11:25:03 +01:00
Lane Seppala
9bdff38f68 Merge pull request #20 from actions/lsep/fix-pseudotarget-filepath
Using 'all' or './...' pseudotarget uses go mod dir
2022-06-28 14:40:35 -06:00
Lane Seppala
f9b94c7a88 Merge branch 'main' into lsep/fix-pseudotarget-filepath 2022-06-28 14:38:22 -06:00
Lane Seppala
6e95c5f6dc Merge pull request #21 from actions/lsep/use-npmjs-published-dep
Use dependency-submission-toolkit published on npmjs.com
2022-06-28 12:06:25 -06:00
Lane Seppala
e888a83630 Remove NPM_AUTH_TOKEN 2022-06-28 11:40:22 -06:00
Lane Seppala
6d17e2c2d5 Merge branch 'main' into lsep/fix-pseudotarget-filepath 2022-06-28 11:34:24 -06:00
Lane Seppala
0281eb47c2 Use dependency-submission-toolkit published on npmjs.com 2022-06-28 11:20:49 -06:00
Lane Seppala
d5d64a591f Use go.mod path instead of containing dir 2022-06-28 11:16:56 -06:00
Brandyn Phelps
410db7b9b4 Fail if generated code is out of date, annotate generated code (#18)
* Fail if generated code is out of date, Annotate generated code

* try shell bash

* Add quotes!

* regenerate following what's in the build

* Add some more context to README
2022-06-27 14:15:19 -07:00
Lane Seppala
931fb377fd Using 'all' or './...' pseudotarget uses go mod dir 2022-06-27 12:09:10 -06:00
Brandyn Phelps
b73c5b4dd8 Correctly validate gomodpath (#19)
* Correctly validate go mod path

* add a reasonable default

* preserve required expectation instead

* regenerate the JS
2022-06-27 09:39:49 -07:00
Brandyn Phelps
a255b6740c Merge pull request #13 from actions/lsep/fix-version-selection
Correctly identify dependency versions chosen by Go
2022-06-24 13:00:47 -07:00
Brandyn Phelps
5aa26966d7 add regenerated files 2022-06-24 19:58:17 +00:00
Brandyn Phelps
91f4cb10b4 Merge branch 'main' into lsep/fix-version-selection 2022-06-23 11:49:05 -07:00
Brandyn Phelps
68f3c0969e Merge pull request #12 from actions/lsep/fix-url-encoding
Do not URL-safe encode the namespace. PackageURL does this
2022-06-23 11:48:05 -07:00
Lane Seppala
d9b3ea0e54 Add JS bundles 2022-06-17 16:44:04 -06:00
Lane Seppala
7bc33fd24d Continue if no matches 2022-06-17 16:39:57 -06:00
Lane Seppala
41f80bd8e1 Include details in error msg 2022-06-17 15:15:23 -06:00
Lane Seppala
79efc0977a Add debug logging 2022-06-17 13:17:17 -06:00
Lane Seppala
be130df09a Correctly identify dependency versions chosen by Go 2022-06-16 22:46:09 -06:00
Lane Seppala
9a1dc9e4d6 Merge branch 'main' into lsep/fix-url-encoding 2022-06-16 22:41:13 -06:00
Lane Seppala
0a044ad723 Add JS bundles 2022-06-16 22:39:10 -06:00
Lane Seppala
89ebd51ca6 Merge pull request #11 from actions/dependabot/npm_and_yarn/undici-5.5.1
Bump undici from 5.2.0 to 5.5.1
2022-06-16 21:12:17 -06:00
Lane Seppala
be13e1879c Merge branch 'main' into dependabot/npm_and_yarn/undici-5.5.1 2022-06-16 21:11:08 -06:00
Lane Seppala
03a3c3735f Update build bundles 2022-06-16 21:09:33 -06:00
Lane Seppala
9ef4f7e494 Merge branch 'main' into lsep/fix-url-encoding 2022-06-16 21:03:56 -06:00
Lane Seppala
44d2d5af5d Merge pull request #9 from brphelps/patch-1
Align snapshot metadata with current detector naming
2022-06-16 21:02:28 -06:00
Lane Seppala
a919ac91a6 Do not URL-safe encode the namespace. PackageURL does this 2022-06-16 21:00:48 -06:00
dependabot[bot]
3b03ea373e Bump undici from 5.2.0 to 5.5.1
Bumps [undici](https://github.com/nodejs/undici) from 5.2.0 to 5.5.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.2.0...v5.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-17 01:59:00 +00:00
Brandyn Phelps
76205cce4d Merge branch 'main' into patch-1 2022-06-16 17:54:16 -07:00
Lane Seppala
983e36b604 Merge pull request #10 from actions/lsep/fix-namespace
Use null namepsace when no namespace for Go package
2022-06-16 16:55:25 -06:00
Lane Seppala
111eaef29a Use null namepsace when no namespace for package 2022-06-16 16:29:00 -06:00
Courtney Claessens
13c5725e5d Merge pull request #8 from courtneycl/update-description
Updating description and author for marketplace
2022-06-16 16:57:20 -04:00
Courtney Claessens
71a21b9b44 Update go-dependency-submission.yml 2022-06-16 16:38:05 -04:00
Brandyn Phelps
d2e9adb5a2 Align snapshot metadata with current detector naming 2022-06-16 13:23:30 -07:00
Courtney Claessens
afc1e79235 Update action.yml 2022-06-16 15:39:07 -04:00
Courtney Claessens
5df5a4f93e updating description and author for marketplace 2022-06-16 15:38:04 -04:00
Anna Rosenthal
7c97cf4cb3 Update to use semver tag instead of main ref (#6) 2022-06-16 12:06:01 -04:00
25 changed files with 32622 additions and 16615 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
dist/* linguist-generated=true

48
.github/workflows/codeql.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '21 0 * * 4'
jobs:
analyze:
name: Analyze
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
# required for all workflows
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
config: |
paths-ignore:
- dist/index.js
- dist/sourcemap-register.js
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View File

@@ -1,5 +1,5 @@
name: Go Dependency Submission
on
on:
push:
branches:
- main
@@ -20,7 +20,7 @@ jobs:
go-version: ">=1.18.0"
- name: Run snapshot action
uses: actions/go-dependency-submission@main
uses: actions/go-dependency-submission@v1
with:
go-mod-path: go-example/go.mod
go-build-target: go-example/cmd/octocat.go

View File

@@ -0,0 +1,26 @@
name: Release new action version
on:
release:
types: [released]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name that the major tag will point to'
required: true
env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
permissions:
contents: write
jobs:
update_tag:
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
environment:
name: releaseNewActionVersion
runs-on: ubuntu-latest
steps:
- name: Update the ${{ env.TAG_NAME }} tag
uses: actions/publish-action@v0.2.1
with:
source-tag: ${{ env.TAG_NAME }}

View File

@@ -19,13 +19,14 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://npm.pkg.github.com'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
node-version: 20
- run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Install NPM dependencies
run: npm ci --ignore-scripts
- run: npm rebuild && npm run all
- name: Build and run tests
run: npm rebuild && npm run all
- name: Verify no uncommitted files
run: '[ -z "$(git status --porcelain=v1 2>/dev/null)" ]'
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

@@ -3,6 +3,15 @@
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.
### Running locally
Because we are checking in the Typescript output, you may see check failures if you don't generate the contents of `dist/` in a similar manner to our CI check. You can easily rectify this by regenerating in a codespace and using what we use in our workflow YAML:
```
npm ci --ignore-scripts
npm rebuild && npm run all
```
### Example
```yaml
name: Go Dependency Submission
@@ -32,7 +41,7 @@ jobs:
go-version: ">=1.18.0"
- name: Run snapshot action
uses: actions/go-dependency-submission@main
uses: actions/go-dependency-submission@v2
with:
# Required: Define the repo path to the go.mod file used by the
# build target

View File

@@ -28,4 +28,4 @@ This information will help us triage your report more quickly.
## Policy
See [GitHub's Safe Harbor Policy](https://docs.github.com/en/github/site-policy/github-bug-bounty-program-legal-safe-harbor#1-safe-harbor-terms)
See [GitHub's Safe Harbor Policy](https://docs.github.com/en/site-policy/security-policies/github-bug-bounty-program-legal-safe-harbor#1-safe-harbor-terms)

View File

@@ -1,6 +1,6 @@
name: 'Go Action for Creating Dependency Snapshots'
description: 'Detects go dependencies in projects using go mod graph utility'
author: 'lorenanicole'
name: 'Go Dependency Submission'
description: 'Calculates dependencies for a Go build-target and submits the list to the Dependency Submission API'
author: 'GitHub'
inputs:
token:
description: "GitHub Personal Access Token (PAT). Defaults to PAT provided by Action runner"
@@ -11,11 +11,12 @@ inputs:
description: 'User provided map of max key/value pairs of metadata to include with the snapshot e.g. {"lastModified": "12-31-2022"}'
go-mod-path:
required: true
description: 'Repo path to the go.mod file used to detect dependencies for the Go build target'
description: 'Repo path to the go.mod file used to detect dependencies for the Go build target. Defaults to go.mod in the root of the repository.'
default: 'go.mod'
go-build-target:
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'
runs:
using: 'node16'
using: 'node20'
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',
],
};

41489
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

159
dist/licenses.txt generated vendored
View File

@@ -71,6 +71,28 @@ The above copyright notice and this permission notice shall be included in all c
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.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
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.
@github/dependency-submission-toolkit
MIT
MIT License
@@ -502,57 +524,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 +545,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 +590,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,47 +626,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.
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

58
dist/parse.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseGoModGraph = exports.parseGoList = exports.parseGoPackage = void 0;
const path_1 = __importDefault(require("path"));
const packageurl_js_1 = require("packageurl-js");
function parseGoPackage(pkg) {
const [qualifiedPackage, version] = pkg.split('@');
let namespace = null;
let name;
if (qualifiedPackage.indexOf('/') !== -1) {
namespace = path_1.default.dirname(qualifiedPackage);
name = path_1.default.basename(qualifiedPackage);
}
else {
name = qualifiedPackage;
}
return new packageurl_js_1.PackageURL('golang', namespace, name, version !== null && version !== void 0 ? version : null, null, null);
}
exports.parseGoPackage = parseGoPackage;
/**
* parseGoList parses a list of Go packages (one per line) matching the format
* "${GO_PACKAGE}@v{VERSION}" into Package URLs. This expects the output of 'go
* list -deps' as input.
*
* @param {string} contents
* @returns {Array<PackageURL>}
*/
function parseGoList(contents) {
// split the input by newlines, sort, and dedup
const packages = Array.from(new Set(contents.split('\n').map((p) => p.trim())));
const purls = [];
packages.forEach((pkg) => {
if (!pkg.trim())
return;
purls.push(parseGoPackage(pkg));
});
return purls;
}
exports.parseGoList = parseGoList;
/**
* parseGoModGraph parses an *associative list* of Go packages into tuples into
* an associative list of PackageURLs. This expects the output of 'go mod
* graph' as input
*/
function parseGoModGraph(contents) {
const pkgAssocList = [];
contents.split('\n').forEach((line) => {
if (!line.trim())
return;
const [parentPkg, childPkg] = line.split(' ');
pkgAssocList.push([parseGoPackage(parentPkg), parseGoPackage(childPkg)]);
});
return pkgAssocList;
}
exports.parseGoModGraph = parseGoModGraph;

128
dist/process.js generated vendored Normal file
View File

@@ -0,0 +1,128 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.processGoIndirectDependencies = exports.processGoDirectDependencies = exports.processGoGraph = void 0;
const exec = __importStar(require("@actions/exec"));
const core = __importStar(require("@actions/core"));
const dependency_submission_toolkit_1 = require("@github/dependency-submission-toolkit");
const parse_1 = require("./parse");
function processGoGraph(goModDir, directDependencies, indirectDependencies) {
return __awaiter(this, void 0, void 0, function* () {
console.log(`Running 'go mod graph' in ${goModDir}`);
const goModGraph = yield exec.getExecOutput('go', ['mod', 'graph'], {
cwd: goModDir
});
if (goModGraph.exitCode !== 0) {
core.error(goModGraph.stderr);
core.setFailed("'go mod graph' failed!");
throw new Error("Failed to execute 'go mod graph'");
}
/* add all direct and indirect packages to a new PackageCache */
const cache = new dependency_submission_toolkit_1.PackageCache();
directDependencies.forEach((pkg) => {
cache.package(pkg);
});
indirectDependencies.forEach((pkg) => {
cache.package(pkg);
});
const packageAssocList = (0, parse_1.parseGoModGraph)(goModGraph.stdout);
packageAssocList.forEach(([parentPkg, childPkg]) => {
/* Look up the parent package in the cache. go mod graph will return
* multiple versions of packages with the same namespace and name. We
* select only package versions used in the Go build target. */
const targetPackage = cache.lookupPackage(parentPkg);
if (!targetPackage)
return;
/* Build a matcher to select on the namespace+name of the child package in
* the cache. The child package version specified by go mod graph is not
* the one guaranteed to be selected when building Go build targets. */
const matcher = {
name: childPkg.name
};
if (childPkg.namespace)
matcher.namespace = childPkg.namespace;
/* There should only ever be a single package with a namespace+name in the
* build target list. Go does not support multiple versions of the same
* package */
const matches = cache.packagesMatching(matcher);
if (matches.length === 0)
return;
if (matches.length !== 1) {
throw new Error('assertion failed: expected no more than one package in cache with namespace+name. ' +
'Found: ' +
JSON.stringify(matches) +
'for ' +
JSON.stringify(matcher));
}
// create the dependency relationship
targetPackage.dependsOn(matches[0]);
});
return cache;
});
}
exports.processGoGraph = processGoGraph;
// For a specific Go _build target_, these templates list dependencies used to
// in the build target. It does not provide association between the
// dependencies (i.e. which dependencies depend on which)
// eslint-disable-next-line quotes
// eslint-disable-next-line no-useless-escape
const GO_DIRECT_DEPS_TEMPLATE = '{{define "M"}}{{if not .Indirect}}{{.Path}}@{{.Version}}{{end}}{{end}}{{with .Module}}{{if not .Main}}{{if .Replace}}{{template "M" .Replace}}{{else}}{{template "M" .}}{{end}}{{end}}{{end}}';
// eslint-disable-next-line quotes
// eslint-disable-next-line no-useless-escape
const GO_INDIRECT_DEPS_TEMPLATE = '{{define "M"}}{{if .Indirect}}{{.Path}}@{{.Version}}{{end}}{{end}}{{with .Module}}{{if not .Main}}{{if .Replace}}{{template "M" .Replace}}{{else}}{{template "M" .}}{{end}}{{end}}{{end}}';
function processGoDirectDependencies(goModDir, goBuildTarget) {
return __awaiter(this, void 0, void 0, function* () {
console.log(`go direct package detection in ${goModDir} on build target ${goBuildTarget}`);
return processGoList(goModDir, goBuildTarget, GO_DIRECT_DEPS_TEMPLATE);
});
}
exports.processGoDirectDependencies = processGoDirectDependencies;
function processGoIndirectDependencies(goModDir, goBuildTarget) {
return __awaiter(this, void 0, void 0, function* () {
console.log(`go indirect package detection in ${goModDir} on build target ${goBuildTarget}`);
return processGoList(goModDir, goBuildTarget, GO_INDIRECT_DEPS_TEMPLATE);
});
}
exports.processGoIndirectDependencies = processGoIndirectDependencies;
function processGoList(goModDir, goBuildTarget, goListTemplate) {
return __awaiter(this, void 0, void 0, function* () {
const goList = yield exec.getExecOutput('go', ['list', '-deps', '-f', goListTemplate, goBuildTarget], { cwd: goModDir });
if (goList.exitCode !== 0) {
core.error(goList.stderr);
core.setFailed("'go list' failed!");
throw new Error("Failed to execute 'go list'");
}
return (0, parse_1.parseGoList)(goList.stdout);
});
}

View File

@@ -7,5 +7,5 @@ require github.com/fatih/color v1.13.0
require (
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/sys v0.1.0 // indirect
)

View File

@@ -7,5 +7,6 @@ github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

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)',
],
};

6885
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,49 +1,53 @@
{
"name": "go-dependency-submission",
"version": "1.0.0",
"version": "2.0.3",
"description": "Go Dependency Submission",
"main": "dist/index.js",
"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",
"test": "jest --testTimeout=10000",
"test:watch": "jest --watch src",
"all": "npm run build && npm run format && npm run lint && npm run package && npm test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dsp-testing/go-dependency-submission.git"
"url": "git+https://github.com/actions/go-dependency-submission.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/dsp-testing/go-dependency-submission/issues"
"url": "https://github.com/actions/go-dependency-submission/issues"
},
"homepage": "https://github.com/dsp-testing/go-dependency-submission#readme",
"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.6.0",
"@actions/core": "^1.9.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.0.3",
"@github/dependency-submission-toolkit": "^1.1.2",
"@actions/github": "^6.0.0",
"@github/dependency-submission-toolkit": "^2.0.5",
"packageurl-js": "^0.0.6"
}
}

View File

@@ -1,16 +1,25 @@
import path from 'path'
import fs from 'fs'
import * as core from '@actions/core'
import * as github from '@actions/github'
import { Snapshot, submitSnapshot } from '@github/dependency-submission-toolkit'
import {
Snapshot,
Manifest,
submitSnapshot
} from '@github/dependency-submission-toolkit'
import { processGoGraph, processGoBuildTarget } from './process'
import {
processGoGraph,
processGoDirectDependencies,
processGoIndirectDependencies
} from './process'
async function main () {
const goModPath = path.normalize(core.getInput('go-mod-path'))
const goModPath = path.normalize(
core.getInput('go-mod-path', { required: true })
)
if (path.basename(goModPath) !== 'go.mod' && fs.existsSync(goModPath)) {
if (path.basename(goModPath) !== 'go.mod' || !fs.existsSync(goModPath)) {
throw new Error(`${goModPath} is not a go.mod file or does not exist!`)
}
const goModDir = path.dirname(goModPath)
@@ -35,16 +44,43 @@ async function main () {
}
}
const packageCache = await processGoGraph(goModDir)
const manifest = await processGoBuildTarget(
const directDeps = await processGoDirectDependencies(goModDir, goBuildTarget)
const indirectDeps = await processGoIndirectDependencies(
goModDir,
goBuildTarget,
packageCache
goBuildTarget
)
const packageCache = await processGoGraph(goModDir, directDeps, indirectDeps)
// if using the pseudotargets "all" or "./...", use the path to go.mod as filepath
const filepath =
goBuildTarget === 'all' || goBuildTarget === './...'
? goModPath
: path.join(goModDir, goBuildTarget)
const manifest = new Manifest(goBuildTarget, filepath)
directDeps.forEach((pkgUrl) => {
const dep = packageCache.lookupPackage(pkgUrl)
if (!dep) {
throw new Error(
'assertion failed: expected all direct dependencies to have entries in PackageCache'
)
}
manifest.addDirectDependency(dep)
})
indirectDeps.forEach((pkgUrl) => {
const dep = packageCache.lookupPackage(pkgUrl)
if (!dep) {
throw new Error(
'assertion failed: expected all indirect dependencies to have entries in PackageCache'
)
}
manifest.addIndirectDependency(dep)
})
const snapshot = new Snapshot(
{
name: 'github-go-dependency-detector',
url: 'https://github.com/github/github-go-dependency-detector',
name: 'actions/go-dependency-submission',
url: 'https://github.com/actions/go-dependency-submission',
version: '0.0.1'
},
github.context,

View File

@@ -1,4 +1,4 @@
import { parseGoList, parseGoModGraph } from './parse'
import { parseGoPackage, parseGoList, parseGoModGraph } from './parse'
const GO_DEPENDENCIES = `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp@v1.7.0
golang.org/x/sys@v0.0.0-20220317061510-51cd9980dadf
@@ -6,7 +6,25 @@ golang.org/x/text@v0.3.7
golang.org/x/text@v0.3.7
golang.org/x/text@v0.3.7`
describe('test dependenciesProcessorFunc', () => {
describe('parseGoPackage', () => {
it('parses a package with a namespace', () => {
expect(parseGoPackage('foo/bar@0.1.2').toString()).toEqual(
'pkg:golang/foo/bar@0.1.2'
)
})
it('parses a package with a namespace with slashes', () => {
expect(parseGoPackage('github.com/foo/bar@0.1.2').toString()).toEqual(
'pkg:golang/github.com/foo/bar@0.1.2'
)
})
it('parses a package without a namespace', () => {
expect(parseGoPackage('foo.io@0.1.2').toString()).toEqual(
'pkg:golang/foo.io@0.1.2'
)
})
})
describe('parseGoList', () => {
test('parses output of go list command into dependencies', () => {
const dependencies = parseGoList(GO_DEPENDENCIES)
@@ -15,7 +33,7 @@ describe('test dependenciesProcessorFunc', () => {
{
type: 'golang',
name: 'otlptracehttp',
namespace: 'go.opentelemetry.io%2Fotel%2Fexporters%2Fotlp%2Fotlptrace',
namespace: 'go.opentelemetry.io/otel/exporters/otlp/otlptrace',
version: 'v1.7.0',
qualifiers: null,
subpath: null
@@ -23,7 +41,7 @@ describe('test dependenciesProcessorFunc', () => {
{
type: 'golang',
name: 'sys',
namespace: 'golang.org%2Fx',
namespace: 'golang.org/x',
version: 'v0.0.0-20220317061510-51cd9980dadf',
qualifiers: null,
subpath: null
@@ -31,7 +49,7 @@ describe('test dependenciesProcessorFunc', () => {
{
type: 'golang',
name: 'text',
namespace: 'golang.org%2Fx',
namespace: 'golang.org/x',
version: 'v0.3.7',
qualifiers: null,
subpath: null
@@ -49,7 +67,7 @@ describe('parseGoModGraph', () => {
expect(assocList[0][0]).toEqual({
type: 'golang',
name: 'go-example',
namespace: '.', // we expect the namespace for the root package to process to dot
namespace: null,
version: null,
qualifiers: null,
subpath: null
@@ -67,7 +85,7 @@ github.com/mattn/go-colorable@v1.1.9 github.com/mattn/go-isatty@v0.0.12`)
{
type: 'golang',
name: 'color',
namespace: 'github.com%2Ffatih',
namespace: 'github.com/fatih',
version: 'v1.13.0',
qualifiers: null,
subpath: null
@@ -75,7 +93,7 @@ github.com/mattn/go-colorable@v1.1.9 github.com/mattn/go-isatty@v0.0.12`)
{
type: 'golang',
name: 'go-isatty',
namespace: 'github.com%2Fmattn',
namespace: 'github.com/mattn',
version: 'v0.0.14',
qualifiers: null,
subpath: null
@@ -85,7 +103,7 @@ github.com/mattn/go-colorable@v1.1.9 github.com/mattn/go-isatty@v0.0.12`)
{
type: 'golang',
name: 'go-colorable',
namespace: 'github.com%2Fmattn',
namespace: 'github.com/mattn',
version: 'v1.1.9',
qualifiers: null,
subpath: null
@@ -93,7 +111,7 @@ github.com/mattn/go-colorable@v1.1.9 github.com/mattn/go-isatty@v0.0.12`)
{
type: 'golang',
name: 'go-isatty',
namespace: 'github.com%2Fmattn',
namespace: 'github.com/mattn',
version: 'v0.0.12',
qualifiers: null,
subpath: null

View File

@@ -1,10 +1,16 @@
import path from 'path'
import { PackageURL } from 'packageurl-js'
function parseGoPackage (pkg: string): PackageURL {
export function parseGoPackage (pkg: string): PackageURL {
const [qualifiedPackage, version] = pkg.split('@')
const namespace = encodeURIComponent(path.dirname(qualifiedPackage))
const name = path.basename(qualifiedPackage)
let namespace: string | null = null
let name: string
if (qualifiedPackage.indexOf('/') !== -1) {
namespace = path.dirname(qualifiedPackage)
name = path.basename(qualifiedPackage)
} else {
name = qualifiedPackage
}
return new PackageURL('golang', namespace, name, version ?? null, null, null)
}

View File

@@ -1,17 +1,86 @@
import { processGoGraph, processGoBuildTarget } from './process'
import {
processGoGraph,
processGoDirectDependencies,
processGoIndirectDependencies
} from './process'
// NOTE: these tests all require "go" to be installed and available on the PATH!
//
describe('processGoGraph', () => {
describe('processGoDirectDependencies', () => {
test('run in go-example', async () => {
const cache = await processGoGraph('go-example')
expect(cache.countPackages()).toEqual(8)
const manifest = await processGoBuildTarget(
const purls = await processGoDirectDependencies(
'go-example',
'cmd/octocat.go',
cache
'cmd/octocat.go'
)
expect(manifest.directDependencies()).toHaveLength(4)
expect(manifest.indirectDependencies()).toHaveLength(2)
expect(purls).toHaveLength(1)
expect(purls).toEqual([
{
type: 'golang',
name: 'color',
namespace: 'github.com/fatih',
version: 'v1.13.0',
qualifiers: null,
subpath: null
}
])
})
})
describe('processGoIndirectDependencies', () => {
test('run in go-example', async () => {
const purls = await processGoIndirectDependencies(
'go-example',
'cmd/octocat.go'
)
expect(purls).toHaveLength(3)
expect(purls).toEqual([
{
type: 'golang',
name: 'sys',
namespace: 'golang.org/x',
version: 'v0.0.0-20210630005230-0f9fa26af87c',
qualifiers: null,
subpath: null
},
{
type: 'golang',
name: 'go-isatty',
namespace: 'github.com/mattn',
version: 'v0.0.14',
qualifiers: null,
subpath: null
},
{
type: 'golang',
name: 'go-colorable',
namespace: 'github.com/mattn',
version: 'v0.1.9',
qualifiers: null,
subpath: null
}
])
})
})
describe('processGoGraph', () => {
test.only('run in go-example', async () => {
const directDeps = await processGoDirectDependencies(
'go-example',
'cmd/octocat.go'
)
const indirectDeps = await processGoIndirectDependencies(
'go-example',
'cmd/octocat.go'
)
const cache = await processGoGraph('go-example', directDeps, indirectDeps)
// we expect the number of direct dependencies + indirect
expect(cache.countPackages()).toEqual(4)
const colorDep = cache.lookupPackage(
'pkg:golang/github.com/fatih/color@v1.13.0'
)
expect(colorDep).not.toBeUndefined()
if (colorDep) expect(colorDep.dependencies).toHaveLength(2)
})
})

View File

@@ -1,16 +1,16 @@
import path from 'path'
import { PackageURL } from 'packageurl-js'
import * as exec from '@actions/exec'
import * as core from '@actions/core'
import {
Manifest,
BuildTarget,
PackageCache
} from '@github/dependency-submission-toolkit'
import { PackageCache } from '@github/dependency-submission-toolkit'
import { parseGoModGraph, parseGoList } from './parse'
export async function processGoGraph (goModDir: string): Promise<PackageCache> {
export async function processGoGraph (
goModDir: string,
directDependencies: Array<PackageURL>,
indirectDependencies: Array<PackageURL>
): Promise<PackageCache> {
console.log(`Running 'go mod graph' in ${goModDir}`)
const goModGraph = await exec.getExecOutput('go', ['mod', 'graph'], {
cwd: goModDir
@@ -21,35 +21,94 @@ export async function processGoGraph (goModDir: string): Promise<PackageCache> {
throw new Error("Failed to execute 'go mod graph'")
}
/* add all direct and indirect packages to a new PackageCache */
const cache = new PackageCache()
directDependencies.forEach((pkg) => {
cache.package(pkg)
})
indirectDependencies.forEach((pkg) => {
cache.package(pkg)
})
const packageAssocList = parseGoModGraph(goModGraph.stdout)
packageAssocList.forEach(([parentPkg, childPkg]) => {
cache.package(parentPkg).dependsOn(cache.package(childPkg))
/* Look up the parent package in the cache. go mod graph will return
* multiple versions of packages with the same namespace and name. We
* select only package versions used in the Go build target. */
const targetPackage = cache.lookupPackage(parentPkg)
if (!targetPackage) return
/* Build a matcher to select on the namespace+name of the child package in
* the cache. The child package version specified by go mod graph is not
* the one guaranteed to be selected when building Go build targets. */
const matcher: { name: string; namespace?: string } = {
name: childPkg.name
}
if (childPkg.namespace) matcher.namespace = childPkg.namespace
/* There should only ever be a single package with a namespace+name in the
* build target list. Go does not support multiple versions of the same
* package */
const matches = cache.packagesMatching(matcher)
if (matches.length === 0) return
if (matches.length !== 1) {
throw new Error(
'assertion failed: expected no more than one package in cache with namespace+name. ' +
'Found: ' +
JSON.stringify(matches) +
'for ' +
JSON.stringify(matcher)
)
}
// create the dependency relationship
targetPackage.dependsOn(matches[0])
})
return cache
}
// For a specific Go _build target_, this template lists all dependencies used
// to build the build target It does not provide association between the
// For a specific Go _build target_, these templates list dependencies used to
// in the build target. It does not provide association between the
// dependencies (i.e. which dependencies depend on which)
// eslint-disable-next-line quotes
// eslint-disable-next-line no-useless-escape
const GO_LIST_DEP_TEMPLATE =
'{{define "M"}}{{.Path}}@{{.Version}}{{end}}{{with .Module}}{{if not .Main}}{{if .Replace}}{{template "M" .Replace}}{{else}}{{template "M" .}}{{end}}{{end}}{{end}}'
const GO_DIRECT_DEPS_TEMPLATE =
'{{define "M"}}{{if not .Indirect}}{{.Path}}@{{.Version}}{{end}}{{end}}{{with .Module}}{{if not .Main}}{{if .Replace}}{{template "M" .Replace}}{{else}}{{template "M" .}}{{end}}{{end}}{{end}}'
// eslint-disable-next-line quotes
// eslint-disable-next-line no-useless-escape
const GO_INDIRECT_DEPS_TEMPLATE =
'{{define "M"}}{{if .Indirect}}{{.Path}}@{{.Version}}{{end}}{{end}}{{with .Module}}{{if not .Main}}{{if .Replace}}{{template "M" .Replace}}{{else}}{{template "M" .}}{{end}}{{end}}{{end}}'
export async function processGoBuildTarget (
export async function processGoDirectDependencies (
goModDir: string,
goBuildTarget: string
): Promise<Array<PackageURL>> {
console.log(
`go direct package detection in ${goModDir} on build target ${goBuildTarget}`
)
return processGoList(goModDir, goBuildTarget, GO_DIRECT_DEPS_TEMPLATE)
}
export async function processGoIndirectDependencies (
goModDir: string,
goBuildTarget: string
): Promise<Array<PackageURL>> {
console.log(
`go indirect package detection in ${goModDir} on build target ${goBuildTarget}`
)
return processGoList(goModDir, goBuildTarget, GO_INDIRECT_DEPS_TEMPLATE)
}
async function processGoList (
goModDir: string,
goBuildTarget: string,
cache: PackageCache
): Promise<Manifest> {
console.log(
`Running go package detection in ${goModDir} on build target ${goBuildTarget}`
)
goListTemplate: string
): Promise<Array<PackageURL>> {
const goList = await exec.getExecOutput(
'go',
['list', '-deps', '-f', GO_LIST_DEP_TEMPLATE, goBuildTarget],
['list', '-deps', '-f', goListTemplate, goBuildTarget],
{ cwd: goModDir }
)
if (goList.exitCode !== 0) {
@@ -58,14 +117,5 @@ export async function processGoBuildTarget (
throw new Error("Failed to execute 'go list'")
}
const dependencies = parseGoList(goList.stdout)
const manifest = new BuildTarget(
goBuildTarget,
path.join(goModDir, goBuildTarget)
)
dependencies.forEach((dep) => {
manifest.addBuildDependency(cache.package(dep))
})
return manifest
return parseGoList(goList.stdout)
}