Compare commits

..

69 Commits

Author SHA1 Message Date
Tom Hu
6d798873df chore(release): 4.4.0 (#1430) 2024-05-14 22:00:11 +07:00
dependabot[bot]
37364fa731 build(deps-dev): bump @typescript-eslint/parser from 7.8.0 to 7.9.0 (#1428)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.8.0 to 7.9.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.9.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 21:50:35 +07:00
Tom Hu
2791a5c4fe fix: remove GPG and run on spawn (#1426)
* fix: first pass remove gpg

* fix: import key

* fix: break validation

* fix: fail ci

* fix: make it the right signature file

* fix: perhaps console

* fix: cleanup

* fix: io the import

* fix: remove from container for now
2024-05-14 21:26:56 +07:00
dependabot[bot]
b71af43c1e build(deps): bump ossf/scorecard-action from 2.3.1 to 2.3.3 (#1420)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.1 to 2.3.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](0864cf1902...dc50aa9510)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 18:54:31 +07:00
dependabot[bot]
29f97fc54f build(deps): bump github/codeql-action from 3.25.3 to 3.25.4 (#1421)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.3 to 3.25.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.25.3...v3.25.4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 18:54:14 +07:00
dependabot[bot]
645d2a5926 build(deps): bump actions/checkout from 4.1.4 to 4.1.5 (#1423)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.4...v4.1.5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 18:53:57 +07:00
Josh Soref
f691d469fb chore: Clarify isPullRequestFromFork (#1411)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2024-05-07 16:41:22 +07:00
Tom Hu
5ecb98a3c6 chore(release): 4.3.1. (#1405) 2024-05-01 22:34:30 +08:00
Tom Hu
5a299d1127 fix: bypass token checks for forks and OIDC (#1404)
* chore(log): dump context

* fix: add logic to bypass token for forks

* fix: running the same things

* fix: more logging

* fix: more core info

* fix: run the func

* fix: cleanup
2024-05-01 15:34:25 +08:00
Marco Biedermann
dad251dcaf docs: main branch (#1396)
Rename `master` to `main`
2024-04-30 16:29:39 +08:00
Marco Biedermann
e8bbe5fc01 docs: Type Annotations (#1397)
Add missing type annotations
2024-04-30 16:29:24 +08:00
dependabot[bot]
a6fd87fc19 build(deps-dev): bump @typescript-eslint/parser from 7.7.1 to 7.8.0 (#1401)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.7.1 to 7.8.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.8.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 16:22:44 +08:00
dependabot[bot]
76c8cd6163 build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.7.1 to 7.8.0 (#1402)
build(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.7.1 to 7.8.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.8.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 16:18:55 +08:00
Marco Biedermann
1290bddc88 style: Node Packages (#1394)
Add the `node:` prefix to imports of node internal packages, making it easier to differentiate
2024-04-29 22:17:32 +08:00
dependabot[bot]
951ef79006 build(deps): bump github/codeql-action from 3.25.1 to 3.25.3 (#1391)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.1 to 3.25.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.25.1...v3.25.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 22:15:00 +08:00
dependabot[bot]
bb71c1ba2f build(deps): bump actions/checkout from 4.1.3 to 4.1.4 (#1392)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.3...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 22:14:52 +08:00
dependabot[bot]
acc5d43cad build(deps): bump actions/upload-artifact from 4.3.2 to 4.3.3 (#1393)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.2 to 4.3.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](1746f4ab65...65462800fd)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 22:14:37 +08:00
Rohan Bhaumik
fab3a2f0ed Update README.md to point to docs about tokenless (#1395)
It wasn't very clear to the community that tokenless was supported. Linked to docs from the action readme.
2024-04-29 22:11:46 +08:00
dependabot[bot]
daf8061cef build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.7.0 to 7.7.1 (#1383)
build(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.7.0 to 7.7.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.7.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 20:27:03 -07:00
dependabot[bot]
a4d9e6ca72 build(deps-dev): bump @typescript-eslint/parser from 7.7.0 to 7.7.1 (#1384)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.7.0 to 7.7.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.7.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 20:22:52 -07:00
dependabot[bot]
c852ea6812 build(deps): bump actions/upload-artifact from 4.3.1 to 4.3.2 (#1380)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.1 to 4.3.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](5d5d22a312...1746f4ab65)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 10:01:18 -07:00
dependabot[bot]
91f8da92ad build(deps): bump github/codeql-action from 3.24.10 to 3.25.1 (#1381)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.10 to 3.25.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.10...v3.25.1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 10:01:08 -07:00
dependabot[bot]
a249bea245 build(deps): bump actions/checkout from 4.1.2 to 4.1.3 (#1382)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 10:00:58 -07:00
dependabot[bot]
8deb5f497d build(deps-dev): bump @typescript-eslint/parser from 7.6.0 to 7.7.0 (#1375)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.6.0 to 7.7.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.7.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 09:27:22 -07:00
dependabot[bot]
c34fe147c2 build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.6.0 to 7.7.0 (#1374)
build(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.6.0 to 7.7.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.7.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 09:12:33 -07:00
ReenigneArcher
86801cdd03 fix: more verbose log message when failing to import pgp key (#1371) 2024-04-15 08:18:38 -07:00
dependabot[bot]
8dff8940ff build(deps-dev): bump typescript from 5.4.4 to 5.4.5 (#1370)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.4 to 5.4.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.4...v5.4.5)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 08:47:23 -07:00
Tom Hu
84508663e9 chore(release): v4.3.0 (#1366) 2024-04-09 10:58:54 -07:00
dependabot[bot]
e8419092e9 build(deps): bump undici from 5.28.3 to 5.28.4 (#1361)
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: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 10:54:18 -07:00
Tom Hu
363a65ad48 feat: add network params (#1365) 2024-04-09 10:53:53 -07:00
dependabot[bot]
640b86a455 build(deps-dev): bump @typescript-eslint/parser from 7.5.0 to 7.6.0 (#1363)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.5.0 to 7.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.6.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 08:20:43 -07:00
dependabot[bot]
375c033fbe build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.5.0 to 7.6.0 (#1364)
build(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.5.0 to 7.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.6.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 08:10:20 -07:00
dependabot[bot]
d701256d7a build(deps): bump github/codeql-action from 3.24.9 to 3.24.10 (#1360)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.9 to 3.24.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.9...v3.24.10)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 08:14:19 -07:00
dependabot[bot]
0bb547ab49 build(deps-dev): bump typescript from 5.4.3 to 5.4.4 (#1355)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.3 to 5.4.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.3...v5.4.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-05 11:52:31 -07:00
Tom Hu
55e8381a3e fix: automatically detect if using GitHub enterprise (#1356) 2024-04-05 11:12:44 -07:00
Tom Hu
7afa10ed9b fix: use_oidc shoudl be required false (#1353) 2024-04-03 15:47:35 -07:00
Tom Hu
d820d60619 feat: allow for authentication via OIDC token (#1330)
* fix: allow for oidc token

* chore(docs): update docs with use_oidc argument

* Update action.yml

Co-authored-by: Cristian Le <github@lecris.me>

* chore(release): 4.2.0

---------

Co-authored-by: Cristian Le <github@lecris.me>
2024-04-03 15:41:48 -07:00
Tom Hu
3a20752bdd chore(deps): update deps (#1351) 2024-04-02 09:06:24 -07:00
Tom Hu
c16abc29c9 chore(release): 4.1.1 (#1344) 2024-03-26 10:58:49 -04:00
Martin Kröning
3e33441c19 fix: typo in disable_safe_directory (#1343)
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2024-03-26 09:58:36 -04:00
dependabot[bot]
85aacc9654 build(deps): bump github/codeql-action from 3.24.7 to 3.24.9 (#1341)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.7 to 3.24.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.7...v3.24.9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 13:08:34 -04:00
dependabot[bot]
4ea9be0fa3 build(deps): bump undici from 5.28.2 to 5.28.3 (#1338)
Bumps [undici](https://github.com/nodejs/undici) from 5.28.2 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.2...v5.28.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-22 09:19:53 -07:00
dependabot[bot]
164fadeaa7 build(deps-dev): bump typescript from 5.4.2 to 5.4.3 (#1334)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.2...v5.4.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-21 09:54:34 -07:00
Tom Hu
4621ecce09 fix: force version (#1329) 2024-03-19 08:19:47 -04:00
dependabot[bot]
251ba34669 build(deps): bump actions/checkout from 4.1.1 to 4.1.2 (#1331)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 09:54:20 -07:00
dependabot[bot]
5a593a5341 build(deps): bump github/codeql-action from 3.24.6 to 3.24.7 (#1332)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.6 to 3.24.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.6...v3.24.7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 09:52:25 -07:00
Joe Becher
a15c0e43ca Removed mention of Mercurial (#1325)
To my knowledge , none of Codecov's supported code hosts support Mercurial, nor does the CLI itself.
2024-03-12 08:16:21 -07:00
dependabot[bot]
8be6ba5782 build(deps-dev): bump typescript from 5.3.3 to 5.4.2 (#1319)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.3.3 to 5.4.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.3.3...v5.4.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 09:59:40 -08:00
dependabot[bot]
e774838850 build(deps): bump github/codeql-action from 3.24.5 to 3.24.6 (#1315)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.5 to 3.24.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.5...v3.24.6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 11:43:11 -08:00
Tom Hu
54bcd8715e chore(release): v4.1.0 (#1307) 2024-02-26 11:44:43 -08:00
dependabot[bot]
8ba77ef8d7 build(deps-dev): bump eslint from 8.56.0 to 8.57.0 (#1305)
Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:32:43 -08:00
dependabot[bot]
c60aa801e3 build(deps): bump github/codeql-action from 3.24.3 to 3.24.5 (#1306)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.3 to 3.24.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.3...v3.24.5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:32:18 -08:00
Tom Hu
2fc4847d3f fix: set safe directory (#1304)
* fix: set safe directory

* fix: naming

* fix: update tests

* fix: dont even check

* fix: add set safe directory

* fix: write test for setSafeDirectory
2024-02-26 11:31:39 -08:00
Tom Hu
0cfda1dd0a chore(release): bump to 4.0.2 (#1302) 2024-02-23 08:17:38 -08:00
dependabot[bot]
7d3a55eb5e build(deps): bump actions/upload-artifact from 4.3.0 to 4.3.1 (#1286)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](26f96dfa69...5d5d22a312)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-20 09:39:54 -05:00
dependabot[bot]
fe84a0b3c0 build(deps-dev): bump @typescript-eslint/eslint-plugin from 6.21.0 to 7.0.0 (#1290)
build(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.21.0 to 7.0.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.0.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-20 09:37:05 -05:00
Jan Macku
e12c9402c4 Use updated syntax for GitHub Markdown notes (#1300)
doc: use updated syntax for GitHub Markdown notes

GitHub Discussions: https://github.com/orgs/community/discussions/16925
2024-02-20 09:25:02 -05:00
dependabot[bot]
ef7f8a5d3c build(deps): bump github/codeql-action from 3.24.0 to 3.24.3 (#1298)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.0 to 3.24.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.0...v3.24.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-20 09:20:22 -05:00
dependabot[bot]
b8a1d6a424 build(deps-dev): bump @typescript-eslint/eslint-plugin from 6.20.0 to 6.21.0 (#1269)
build(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.20.0 to 6.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.21.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 23:11:07 -08:00
dependabot[bot]
6ef7ea4c74 build(deps-dev): bump @typescript-eslint/parser from 6.20.0 to 6.21.0 (#1271)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.20.0 to 6.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.21.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 09:54:06 -08:00
Bo Anderson
f62c5eebfe fix: working-directory input for all stages (#1272) 2024-02-06 09:53:39 -08:00
Ian Lewis
fdbfa4b889 Add link to docs on Dependabot secrets (#1260) 2024-02-05 09:30:37 -08:00
John T. Wodder II
9855cf7bd1 Escape pipes in table of arguments (#1265) 2024-02-05 09:30:15 -08:00
dependabot[bot]
162c44c603 build(deps): bump github/codeql-action from 3.23.2 to 3.24.0 (#1266)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.23.2 to 3.24.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.23.2...v3.24.0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 09:26:44 -08:00
dependabot[bot]
a9883cc0b2 build(deps-dev): bump @types/jest from 29.5.11 to 29.5.12 (#1257)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.11 to 29.5.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 09:17:04 -08:00
Tom Hu
8c40c8cd55 Update README.md 2024-02-01 15:44:10 -08:00
Tom Hu
781907b2be Update README.md 2024-02-01 15:42:02 -08:00
Tom Hu
93b3dea0bf Update action.yml 2024-02-01 15:33:11 -08:00
Tom Hu
82ab52d110 Update README.md (#1251) 2024-02-01 14:26:09 -08:00
18 changed files with 3024 additions and 2524 deletions

View File

@@ -17,6 +17,7 @@
"@typescript-eslint"
],
"rules": {
"max-len": ["error", { "code": 120 }],
"linebreak-style": 0
}
}

View File

@@ -12,10 +12,10 @@ name: "CodeQL"
on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ main ]
schedule:
- cron: '24 6 * * 5'
@@ -37,11 +37,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.1.5
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.23.2
uses: github/codeql-action/init@v3.25.4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -52,7 +52,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3.23.2
uses: github/codeql-action/autobuild@v3.25.4
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -66,4 +66,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.23.2
uses: github/codeql-action/analyze@v3.25.4

View File

@@ -2,7 +2,7 @@ name: Enforce License Compliance
on:
pull_request:
branches: [main, master]
branches: [main]
jobs:
enforce-license-compliance:

View File

@@ -8,7 +8,50 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest, macos-latest-xlarge]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4.1.5
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Run tests and collect coverage
run: npm run test
- name: Upload coverage to Codecov (script)
uses: ./
with:
fail_ci_if_error: true
files: ./coverage/script/coverage-final.json
flags: script,${{ matrix.os }}
name: codecov-script
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov (demo)
uses: ./
with:
fail_ci_if_error: true
files: ./coverage/calculator/coverage-final.json,./coverage/coverage-test/coverage-final.json
file: ./coverage/coverage-final.json
flags: demo,${{ matrix.os }}
name: codecov-demo
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov (version)
uses: ./
with:
fail_ci_if_error: true
files: ./coverage/calculator/coverage-final.json,./coverage/coverage-test/coverage-final.json
file: ./coverage/coverage-final.json
flags: version,${{ matrix.os }}
name: codecov-version
version: v0.2.0
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
run-container:
runs-on: ubuntu-latest
container: node:18
steps:
- name: Checkout
uses: actions/checkout@v4.1.5
- name: Install dependencies
run: npm install
- name: Lint

View File

@@ -5,7 +5,7 @@ on:
schedule:
- cron: '43 20 * * 1'
push:
branches: [ master ]
branches: [ main ]
# Declare default permissions as read only.
permissions: read-all
@@ -24,12 +24,12 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v4.1.1 # v3.0.0
uses: actions/checkout@v4.1.5 # v3.0.0
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
@@ -48,7 +48,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: SARIF file
path: results.sarif
@@ -56,6 +56,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@v3.23.2 # v1.0.26
uses: github/codeql-action/upload-sarif@v3.25.4 # v1.0.26
with:
sarif_file: results.sarif

View File

@@ -1,6 +1,6 @@
# Codecov GitHub Action
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v3-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov)
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v4-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_shield)
[![Workflow for Codecov Action](https://github.com/codecov/codecov-action/actions/workflows/main.yml/badge.svg)](https://github.com/codecov/codecov-action/actions/workflows/main.yml)
### Easily upload coverage reports to Codecov from GitHub Actions
@@ -8,10 +8,13 @@
## v4 Release
`v4` of the Codecov GitHub Action will use the [Codecov CLI](https://github.com/codecov/codecov-cli) to upload coverage reports to Codecov.
Breaking Changes
- Tokenless uploading is unsupported. However, PRs made from forks to the upstream public repos will support tokenless (e.g. contributors to OS projects do not need the upstream repo's Codecov token)
### Breaking Changes
- Tokenless uploading is unsupported. However, PRs made from forks to the upstream public repos will support tokenless (e.g. contributors to OS projects do not need the upstream repo's Codecov token). For details, [see our docs](https://docs.codecov.com/docs/codecov-uploader#supporting-token-less-uploads-for-forks-of-open-source-repos-using-codecov)
- Various arguments to the Action have been removed
### Dependabot
- For repositories using `Dependabot`, users will need to ensure that it has access to the Codecov token for PRs from Dependabot to upload coverage. To do this, please add your `CODECOV_TOKEN` as a Dependabot Secret. For more information, see ["Configuring access to private registries for Dependabot."](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/configuring-access-to-private-registries-for-dependabot#storing-credentials-for-dependabot-to-use)
`v3` versions and below will not have access to CLI features (e.g. global upload token, ATS).
## Usage
@@ -32,7 +35,7 @@ Inside your `.github/workflows/workflow.yml` file:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/checkout@main
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
@@ -47,7 +50,7 @@ The Codecov token can also be passed in via environment variables:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/checkout@main
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
@@ -58,53 +61,59 @@ steps:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
```
>**Note**: This assumes that you've set your Codecov token inside *Settings > Secrets* as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io). Keep in mind that secrets are *not* available to forks of repositories.
> [!NOTE]
> This assumes that you've set your Codecov token inside *Settings > Secrets* as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io). Keep in mind that secrets are *not* available to forks of repositories.
### Using OIDC
For users with [OpenID Connect(OIDC) enabled](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect), the Codecov token is not necessary. You can use OIDC with the `use_oidc` argument as following.
```yaml
- uses: codecov/codecov-action@v4
with:
use_oidc: true
```
Any token supplied will be ignored, as Codecov will default to the OIDC token for verification.
## Arguments
Codecov's Action supports inputs from the user. These inputs, along with their descriptions and usage contexts, are listed in the table below:
| Input | Description | Usage |
| :---: | :---: | :---: |
| `token` | Used to authorize coverage report uploads | *Required |
| `move_coverage_to_trash` | Move discovered coverage reports to the trash | Optional
| `commit_parent` | The commit SHA of the parent for which you are uploading coverage. If not present, the parent will be determined using the API of your repository provider. When using the repository provider's API, the parent is determined via finding the closest ancestor to the commit. | Optional
| Input | Description | Required |
| :--- | :--- | :---: |
| `token` | Repository Codecov token. Used to authorize report uploads | *Required
| `codecov_yml_path` | Specify the path to the Codecov YML | Optional
| `commit_parent` | Override to specify the parent commit SHA | Optional
| `directory` | Directory to search for coverage reports. | Optional
| `disable_search` | Disable search for coverage files. This is helpful when specifying what files you want to upload with the --file option. | Optional
| `disable_file_fixes` | Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets) | Optional
| `dry_run` | Don't upload files to Codecov | Optional
| `env_vars` | Environment variables to tag the upload with. Multiple env variables can be separated with commas (e.g. `OS,PYTHON`) | Optional
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
| `files` | Comma-separated paths to the coverage report(s). Negated paths are supported by starting with `!` | Optional
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional
| `full_report` | Specify the path of a full Codecov report to re-upload | Optional
| `functionalities` | Toggle functionalities | Optional
| -- `network` | Disable uploading the file network | Optional
| -- `fixes` | Enable file fixes to ignore common lines from coverage | Optional
| -- `search` | Disable searching for coverage files | Optional
| `gcov` | Run with gcov support | Optional
| `gcov_args` | Extra arguments to pass to gcov | Optional
| `gcov_ignore` | Paths to ignore during gcov gathering | Optional
| `gcov_include` | Paths to include during gcov gathering | Optional
| `gcov_executable` | gcov executable to run. Defaults to gcov. | Optional
| `name` | Custom defined name for the upload | Optional
| `network_filter` | Specify a filter on the files listed in the network section of the Codecov report. Useful for upload-specific path fixing | Optional
| `network_prefix` | Specify a prefix on files listed in the network section of the Codecov report. Useful to help resolve path fixing | Optional
| `os` | Specify the OS (linux, macos, windows, alpine) | Optional
| `env_vars` | Environment variables to tag the upload with (e.g. PYTHON \| OS,PYTHON) | Optional
| `exclude` | Folders to exclude from search | Optional
| `fail_ci_if_error` | Specify whether or not CI build should fail if Codecov runs into an error during upload | Optional
| `file` | Path to coverage file to upload | Optional
| `files` | Comma-separated list of files to upload | Optional
| `flags` | Flag upload to group coverage metrics (e.g. unittests \| integration \| ui,chrome) | Optional
| `handle_no_reports_found` | Raise no exceptions when no coverage reports found | Optional
| `job_code` | The job code | Optional
| `name` | User defined upload name. Visible in Codecov UI | Optional
| `os` | Override the assumed OS. Options are linux \| macos \| windows \| . | Optional
| `override_branch` | Specify the branch name | Optional
| `override_build` | Specify the build number | Optional
| `override_build_url` | The URL of the build where this is running | Optional
| `override_commit` | Specify the commit SHA | Optional
| `override_pr` | Specify the pull request number | Optional
| `override_tag` | Specify the git tag | Optional
| `root_dir` | Used when not in git/hg project to identify project root directory | Optional
| `directory` | Directory to search for coverage reports. | Optional
| `plugin` | plugins to run. Options: xcode, gcov, pycoverage. The default behavior runs them all. | Optional
| `plugins` | Comma-separated list of plugins for use during upload. | Optional
| `report_code` | The code of the report. If unsure, do not include | Optional
| `root_dir` | Used to specify the location of your .git root to identify project root directory | Optional
| `slug` | Specify the slug manually (Enterprise use) | Optional
| `swift` | Run with swift coverage support | Optional
| -- `swift_project` | Specify the swift project to speed up coverage conversion | Optional
| `upstream_proxy` | The upstream http proxy server to connect through | Optional
| `url` | Change the upload host (Enterprise use) | Optional
| `url` | Specify the base url to upload (Enterprise use) | Optional
| `use_legacy_upload_endpoint` | Use the legacy upload endpoint | Optional
| `use_oidc` | Use OpenID Connect for verification instead of token. This will ignore any token supplied. Please see [GitHub documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) for details.
| `verbose` | Specify whether the Codecov output should be verbose | Optional
| `version` | Specify which version of the Codecov Uploader should be used. Defaults to `latest` | Optional
| `working-directory` | Directory in which to execute `codecov.sh` | Optional
| `xtra_args` | Add additional uploader args that may be missing in the Action | Optional
| `version` | Specify which version of the Codecov CLI should be used. Defaults to `latest` | Optional
| `working-directory` | Directory in which to execute codecov.sh | Optional
### Example `workflow.yml` with Codecov Action
@@ -121,9 +130,9 @@ jobs:
OS: ${{ matrix.os }}
PYTHON: '3.10'
steps:
- uses: actions/checkout@master
- uses: actions/checkout@main
- name: Setup Python
uses: actions/setup-python@master
uses: actions/setup-python@main
with:
python-version: 3.10
- name: Generate coverage report

View File

@@ -3,7 +3,7 @@ description: 'GitHub Action that uploads coverage reports for your repository to
author: 'Ibrahim Ali <@ibrahim0814> & Thomas Hu <@thomasrockhu> | Codecov'
inputs:
token:
description: 'Repository upload token - get it from codecov.io. Required only for private repositories'
description: 'Repository Codecov token. Used to authorize report uploads'
required: false
codecov_yml_path:
description: 'Specify the path to the Codecov YML'
@@ -14,11 +14,14 @@ inputs:
directory:
description: 'Directory to search for coverage reports.'
required: false
disable_file_fixes:
description: 'Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets)'
required: false
disable_search:
description: 'Disable search for coverage files. This is helpful when specifying what files you want to upload with the --file option.'
required: false
disable_file_fixes:
description: 'Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets)'
disable_safe_directory:
description: 'Disable setting safe directory. Set to true to disable.'
required: false
dry_run:
description: "Don't upload files to Codecov"
@@ -41,6 +44,9 @@ inputs:
flags:
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
required: false
git_service:
description: 'Override the git_service (e.g. github_enterprise)'
required: false
handle_no_reports_found:
description: 'Raise no exceptions when no coverage reports found'
required: false
@@ -50,6 +56,12 @@ inputs:
name:
description: 'User defined upload name. Visible in Codecov UI'
required: false
network_filter:
description: 'Specify a filter on the files listed in the network section of the Codecov report. This will only add files whose path begin with the specified filter. Useful for upload-specific path fixing'
required: false
network_prefix:
description: 'Specify a prefix on files listed in the network section of the Codecov report. Useful to help resolve path fixing'
required: false
os:
description: 'Override the assumed OS. Options are linux | macos | windows.'
required: false
@@ -89,6 +101,9 @@ inputs:
use_legacy_upload_endpoint:
description: 'Use the legacy upload endpoint'
required: false
use_oidc:
description: 'Use OIDC instead of token. This will ignore any token supplied'
required: false
verbose:
description: 'Specify whether the Codecov output should be verbose'
required: false

4128
dist/index.js vendored

File diff suppressed because it is too large Load Diff

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

647
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "codecov-action",
"version": "4.0.1",
"version": "4.4.0",
"description": "Upload coverage reports to Codecov from GitHub Actions",
"main": "index.js",
"scripts": {
@@ -26,19 +26,18 @@
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"gpg": "^0.6.0",
"undici": "5.28.2"
"undici": "5.28.4"
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.9.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-google": "^0.14.0",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"ts-jest": "^29.1.2",
"typescript": "^5.3.3"
"typescript": "^5.4.5"
}
}

View File

@@ -7,10 +7,20 @@ import {
buildUploadExec,
} from './buildExec';
const context = github.context;
test('general args', () => {
let OLDOS = process.env.RUNNER_OS;
beforeEach(() => {
jest.resetModules();
OLDOS = process.env.RUNNER_OS;
});
afterAll(() => {
process.env.RUNNER_OS = OLDOS;
});
test('general args', async () => {
const envs = {
codecov_yml_path: 'dev/codecov.yml',
url: 'https://codecov.enterprise.com',
@@ -20,7 +30,7 @@ test('general args', () => {
process.env['INPUT_' + env.toUpperCase()] = envs[env];
}
const {args, verbose} = buildGeneralExec();
const {args, verbose} = await buildGeneralExec();
expect(args).toEqual(
expect.arrayContaining([
@@ -36,12 +46,14 @@ test('general args', () => {
}
});
test('upload args using context', () => {
const expectedArgs = [];
const {uploadExecArgs, uploadCommand} = buildUploadExec();
test('upload args using context', async () => {
const expectedArgs = [
'--git-service',
'github',
];
const {uploadExecArgs, uploadCommand} = await buildUploadExec();
if (context.eventName == 'pull_request') {
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
expectedArgs.push('-C', `${context.payload.pull_request?.head.sha}`);
}
if (context.eventName == 'pull_request_target') {
expectedArgs.push('-P', `${context.payload.number}`);
@@ -51,7 +63,7 @@ test('upload args using context', () => {
expect(uploadCommand).toEqual('do-upload');
});
test('upload args', () => {
test('upload args', async () => {
const envs = {
'codecov_yml_path': 'dev/codecov.yml',
'commit_parent': 'fakeparentcommit',
@@ -65,6 +77,7 @@ test('upload args', () => {
'file': 'coverage.xml',
'files': 'dir1/coverage.xml,dir2/coverage.xml',
'flags': 'test,test2',
'git_service': 'github_enterprise',
'handle_no_reports_found': 'true',
'job_code': '32',
'name': 'codecov',
@@ -74,6 +87,8 @@ test('upload args', () => {
'override_build_url': 'https://example.com/build/2',
'override_commit': '9caabca5474b49de74ef5667deabaf74cdacc244',
'override_pr': '2',
'network_filter': 'subA/',
'network_prefix': 'forA/',
'plugin': 'xcode',
'plugins': 'pycoverage,compress-pycoverage',
'report_code': 'testCode',
@@ -90,7 +105,7 @@ test('upload args', () => {
process.env['INPUT_' + env.toUpperCase()] = envs[env];
}
const {uploadExecArgs, uploadCommand} = buildUploadExec();
const {uploadExecArgs, uploadCommand} = await buildUploadExec();
const expectedArgs = [
'--disable-file-fixes',
'--disable-search',
@@ -110,11 +125,17 @@ test('upload args', () => {
'test',
'-F',
'test2',
'--git-service',
'github_enterprise',
'--handle-no-reports-found',
'--job-code',
'32',
'-n',
'codecov',
'--network-filter',
'subA/',
'--network-prefix',
'forA/',
'-B',
'thomasrockhu/test',
'-b',
@@ -150,8 +171,9 @@ test('upload args', () => {
});
test('report args', () => {
test('report args', async () => {
const envs = {
git_service: 'github_enterprise',
override_commit: '9caabca5474b49de74ef5667deabaf74cdacc244',
override_pr: 'fakePR',
slug: 'fakeOwner/fakeRepo',
@@ -162,9 +184,11 @@ test('report args', () => {
process.env['INPUT_' + env.toUpperCase()] = envs[env];
}
const {reportExecArgs, reportCommand} = buildReportExec();
const {reportExecArgs, reportCommand} = await buildReportExec();
const expectedArgs = [
'--git-service',
'github_enterprise',
'-C',
'9caabca5474b49de74ef5667deabaf74cdacc244',
'-P',
@@ -182,19 +206,22 @@ test('report args', () => {
});
test('report args using context', () => {
test('report args using context', async () => {
const envs = {
token: 'd3859757-ab80-4664-924d-aef22fa7557b',
};
for (const env of Object.keys(envs)) {
process.env['INPUT_' + env.toUpperCase()] = envs[env];
}
const expectedArgs : string[] = [];
const expectedArgs : string[] = [
'--git-service',
'github',
];
if (context.eventName == 'pull_request') {
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
expectedArgs.push('-C', `${context.payload.pull_request?.head.sha}`);
}
const {reportExecArgs, reportCommand} = buildReportExec();
const {reportExecArgs, reportCommand} = await buildReportExec();
expect(reportExecArgs).toEqual(expectedArgs);
expect(reportCommand).toEqual('create-report');
@@ -204,8 +231,9 @@ test('report args using context', () => {
});
test('commit args', () => {
test('commit args', async () => {
const envs = {
git_service: 'github_enterprise',
commit_parent: '83231650328f11695dfb754ca0f540516f188d27',
override_branch: 'thomasrockhu/test',
override_commit: '9caabca5474b49de74ef5667deabaf74cdacc244',
@@ -218,10 +246,12 @@ test('commit args', () => {
process.env['INPUT_' + env.toUpperCase()] = envs[env];
}
const {commitExecArgs, commitCommand} = buildCommitExec();
const {commitExecArgs, commitCommand} = await buildCommitExec();
const expectedArgs = [
'--parent-sha',
'83231650328f11695dfb754ca0f540516f188d27',
'--git-service',
'github_enterprise',
'-B',
'thomasrockhu/test',
'-C',
@@ -240,12 +270,35 @@ test('commit args', () => {
}
});
test('commit args using context', () => {
const expectedArgs :string[] = [];
test('commit args using context', async () => {
const expectedArgs :string[] = [
'--git-service',
'github',
];
const {commitExecArgs, commitCommand} = buildCommitExec();
const {commitExecArgs, commitCommand} = await buildCommitExec();
if (context.eventName == 'pull_request') {
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
expectedArgs.push('-C', `${context.payload.pull_request?.head.sha}`);
}
if (context.eventName == 'pull_request_target') {
expectedArgs.push('-P', `${context.payload.number}`);
}
expect(commitExecArgs).toEqual(expectedArgs);
expect(commitCommand).toEqual('create-commit');
});
test('commit args using github server url', async () => {
const expectedArgs :string[] = [
'--git-service',
'github_enterprise',
];
process.env.GITHUB_SERVER_URL = 'https://example.com';
const {commitExecArgs, commitCommand} = await buildCommitExec();
if (context.eventName == 'pull_request') {
expectedArgs.push('-C', `${context.payload.pull_request?.head.sha}`);
}
if (context.eventName == 'pull_request_target') {
expectedArgs.push('-P', `${context.payload.number}`);

View File

@@ -3,10 +3,11 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import {setFailure} from './helpers';
const context = github.context;
const isTrue = (variable) => {
const isTrue = (variable: string): boolean => {
const lowercase = variable.toLowerCase();
return (
lowercase === '1' ||
@@ -17,15 +18,71 @@ const isTrue = (variable) => {
);
};
const getGitService = (): string => {
const overrideGitService = core.getInput('git_service');
const serverUrl = process.env.GITHUB_SERVER_URL;
if (overrideGitService) {
return overrideGitService;
} else if (serverUrl !== undefined && serverUrl !== 'https://github.com') {
return 'github_enterprise';
}
return 'github';
};
const buildCommitExec = () => {
const isPullRequestFromFork = (): boolean => {
if (
`${context.eventName}` !== 'pull_request' ||
`${context.eventName}` !== 'pull_request_target'
) {
return false;
}
const baseLabel = context.payload.pull_request.base.label;
const headLabel = context.payload.pull_request.head.label;
core.info(`baseRef: ${baseLabel} | headRef: ${headLabel}`);
return (baseLabel.split(':')[0] !== headLabel.split(':')[0]);
};
const getToken = async (): Promise<string> => {
if (isPullRequestFromFork()) {
core.info('==> Fork detected, tokenless uploading used');
return Promise.resolve('');
}
let token = core.getInput('token');
let url = core.getInput('url');
const useOIDC = isTrue(core.getInput('use_oidc'));
if (useOIDC) {
if (!url) {
url = 'https://codecov.io';
}
try {
token = await core.getIDToken(url);
return token;
} catch (err) {
setFailure(
`Codecov: Failed to get OIDC token with url: ${url}. ${err.message}`,
true,
);
}
}
return token;
};
const buildCommitExec = async (): Promise<{
commitExecArgs: any[];
commitOptions: any;
commitCommand: string;
}> => {
const commitParent = core.getInput('commit_parent');
const gitService = getGitService();
const overrideBranch = core.getInput('override_branch');
const overrideCommit = core.getInput('override_commit');
const overridePr = core.getInput('override_pr');
const slug = core.getInput('slug');
const token = core.getInput('token');
const token = await getToken();
const failCi = isTrue(core.getInput('fail_ci_if_error'));
const workingDir = core.getInput('working-directory');
const commitCommand = 'create-commit';
const commitExecArgs = [];
@@ -47,6 +104,7 @@ const buildCommitExec = () => {
if (commitParent) {
commitExecArgs.push('--parent-sha', `${commitParent}`);
}
commitExecArgs.push('--git-service', `${gitService}`);
if (overrideBranch) {
commitExecArgs.push('-B', `${overrideBranch}`);
@@ -72,12 +130,18 @@ const buildCommitExec = () => {
if (failCi) {
commitExecArgs.push('-Z');
}
if (workingDir) {
commitOptions.cwd = workingDir;
}
return {commitExecArgs, commitOptions, commitCommand};
};
const buildGeneralExec = () => {
const buildGeneralExec = (): {
args: any[];
verbose: boolean;
} => {
const codecovYmlPath = core.getInput('codecov_yml_path');
const url = core.getInput('url');
const verbose = isTrue(core.getInput('verbose'));
@@ -95,12 +159,18 @@ const buildGeneralExec = () => {
return {args, verbose};
};
const buildReportExec = () => {
const buildReportExec = async (): Promise<{
reportExecArgs: any[];
reportOptions: any;
reportCommand: string;
}> => {
const gitService = getGitService();
const overrideCommit = core.getInput('override_commit');
const overridePr = core.getInput('override_pr');
const slug = core.getInput('slug');
const token = core.getInput('token');
const token = await getToken();
const failCi = isTrue(core.getInput('fail_ci_if_error'));
const workingDir = core.getInput('working-directory');
const reportCommand = 'create-report';
@@ -120,6 +190,8 @@ const buildReportExec = () => {
if (token) {
reportOptions.env.CODECOV_TOKEN = token;
}
reportExecArgs.push('--git-service', `${gitService}`);
if (overrideCommit) {
reportExecArgs.push('-C', `${overrideCommit}`);
} else if (
@@ -141,12 +213,24 @@ const buildReportExec = () => {
if (failCi) {
reportExecArgs.push('-Z');
}
if (workingDir) {
reportOptions.cwd = workingDir;
}
return {reportExecArgs, reportOptions, reportCommand};
};
const buildUploadExec = () => {
const buildUploadExec = async (): Promise<{
uploadExecArgs: any[];
uploadOptions: any;
disableSafeDirectory: boolean;
failCi: boolean;
os: string;
uploaderVersion: string;
uploadCommand: string;
}> => {
const disableFileFixes = isTrue(core.getInput('disable_file_fixes'));
const disableSafeDirectory = isTrue(core.getInput('disable_safe_directory'));
const disableSearch = isTrue(core.getInput('disable_search'));
const dryRun = isTrue(core.getInput('dry_run'));
const envVars = core.getInput('env_vars');
@@ -155,9 +239,12 @@ const buildUploadExec = () => {
const file = core.getInput('file');
const files = core.getInput('files');
const flags = core.getInput('flags');
const gitService = getGitService();
const handleNoReportsFound = isTrue(core.getInput('handle_no_reports_found'));
const jobCode = core.getInput('job_code');
const name = core.getInput('name');
const networkFilter = core.getInput('network_filter');
const networkPrefix = core.getInput('network_prefix');
const os = core.getInput('os');
const overrideBranch = core.getInput('override_branch');
const overrideBuild = core.getInput('override_build');
@@ -170,7 +257,7 @@ const buildUploadExec = () => {
const rootDir = core.getInput('root_dir');
const searchDir = core.getInput('directory');
const slug = core.getInput('slug');
const token = core.getInput('token');
const token = await getToken();
let uploaderVersion = core.getInput('version');
const useLegacyUploadEndpoint = isTrue(
core.getInput('use_legacy_upload_endpoint'),
@@ -231,6 +318,7 @@ const buildUploadExec = () => {
uploadExecArgs.push('-F', `${f}`);
});
}
uploadExecArgs.push('--git-service', `${gitService}`);
if (handleNoReportsFound) {
uploadExecArgs.push('--handle-no-reports-found');
}
@@ -240,6 +328,12 @@ const buildUploadExec = () => {
if (name) {
uploadExecArgs.push('-n', `${name}`);
}
if (networkFilter) {
uploadExecArgs.push('--network-filter', `${networkFilter}`);
}
if (networkPrefix) {
uploadExecArgs.push('--network-prefix', `${networkPrefix}`);
}
if (overrideBranch) {
uploadExecArgs.push('-B', `${overrideBranch}`);
}
@@ -297,6 +391,7 @@ const buildUploadExec = () => {
return {
uploadExecArgs,
uploadOptions,
disableSafeDirectory,
failCi,
os,
uploaderVersion,

View File

@@ -1,10 +1,13 @@
import * as exec from '@actions/exec';
import {
PLATFORMS,
getBaseUrl,
getCommand,
getPlatform,
isValidPlatform,
isWindows,
PLATFORMS,
getCommand,
setSafeDirectory,
} from './helpers';
let OLDOS = process.env.RUNNER_OS;
@@ -78,3 +81,16 @@ test('getCommand', () => {
expect(getCommand('path', ['-v', '-x'], 'do-upload'))
.toEqual(['path', '-v', '-x', 'do-upload']);
});
test('setSafeDirectory', async () => {
process.env.GITHUB_WORKSPACE = 'testOrg/testRepo';
await setSafeDirectory();
const testSafeDirectory = ([
'git',
'config',
'--get',
'safe.directory',
]).join(' ');
const safeDirectory = await exec.getExecOutput(testSafeDirectory);
expect(safeDirectory.stdout).toBe('testOrg/testRepo\n');
});

View File

@@ -1,4 +1,5 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
const PLATFORMS = [
'linux',
@@ -7,7 +8,8 @@ const PLATFORMS = [
'alpine',
'linux-arm64',
'alpine-arm64',
];
] as const;
type Platform = typeof PLATFORMS[number];
const setFailure = (message: string, failCi: boolean): void => {
failCi ? core.setFailed(message) : core.warning(message);
@@ -24,8 +26,8 @@ const getUploaderName = (platform: string): string => {
}
};
const isValidPlatform = (platform: string): boolean => {
return PLATFORMS.includes(platform);
const isValidPlatform = (platform: string): platform is Platform => {
return PLATFORMS.includes(platform as Platform);
};
const isWindows = (platform: string): boolean => {
@@ -64,6 +66,19 @@ const getCommand = (
return fullCommand;
};
const setSafeDirectory = async () => {
const command = ([
'git',
'config',
'--global',
'--add',
'safe.directory',
`${process.env['GITHUB_WORKSPACE']}`,
].join(' '));
core.info(`==> Running ${command}`);
await exec.exec(command);
};
export {
PLATFORMS,
getBaseUrl,
@@ -72,5 +87,6 @@ export {
isValidPlatform,
isWindows,
setFailure,
setSafeDirectory,
getCommand,
};

View File

@@ -1,6 +1,6 @@
import * as fs from 'fs';
import * as https from 'https';
import * as path from 'path';
import * as fs from 'node:fs';
import * as https from 'node:https';
import * as path from 'node:path';
import * as exec from '@actions/exec';
@@ -12,10 +12,11 @@ import {
} from './buildExec';
import {
getBaseUrl,
getCommand,
getPlatform,
getUploaderName,
setFailure,
getCommand,
setSafeDirectory,
} from './helpers';
import verify from './validate';
@@ -23,17 +24,19 @@ import versionInfo from './version';
let failCi;
try {
const {commitExecArgs, commitOptions, commitCommand} = buildCommitExec();
const {reportExecArgs, reportOptions, reportCommand} = buildReportExec();
const run = async (): Promise<void> => {
try {
const {commitExecArgs, commitOptions, commitCommand} = await buildCommitExec();
const {reportExecArgs, reportOptions, reportCommand} = await buildReportExec();
const {
uploadExecArgs,
uploadOptions,
disableSafeDirectory,
failCi,
os,
uploaderVersion,
uploadCommand,
} = buildUploadExec();
} = await buildUploadExec();
const {args, verbose} = buildGeneralExec();
const platform = getPlatform(os);
@@ -55,8 +58,11 @@ try {
await verify(filename, platform, uploaderVersion, verbose, failCi);
await versionInfo(platform, uploaderVersion);
await fs.chmodSync(filename, '777');
if (!disableSafeDirectory) {
await setSafeDirectory();
}
const unlink = () => {
const unlink = (): void => {
fs.unlink(filename, (err) => {
if (err) {
setFailure(
@@ -66,7 +72,7 @@ try {
}
});
};
const doUpload = async () => {
const doUpload = async (): Promise<void> => {
await exec.exec(getCommand(filename, args, uploadCommand).join(' '),
uploadExecArgs,
uploadOptions)
@@ -78,7 +84,7 @@ try {
);
});
};
const createReport = async () => {
const createReport = async (): Promise<void> => {
await exec.exec(
getCommand(filename, args, reportCommand).join(' '),
reportExecArgs,
@@ -115,6 +121,9 @@ try {
});
});
});
} catch (err) {
} catch (err) {
setFailure(`Codecov: Encountered an unexpected error ${err.message}`, failCi);
}
}
};
run();

View File

@@ -1,7 +1,7 @@
import * as crypto from 'crypto';
import * as fs from 'fs';
import * as gpg from 'gpg';
import * as path from 'path';
import {execSync} from 'node:child_process';
import * as crypto from 'node:crypto';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as core from '@actions/core';
import {request} from 'undici';
@@ -76,36 +76,43 @@ const verify = async (
}
};
const verifySignature = () => {
gpg.call('', [
const verifySignature = async () => {
const command = [
'gpg',
'--logger-fd',
'1',
'--verify',
path.join(__dirname, `${uploaderName}.SHA256SUM.sig`),
path.join(__dirname, `${uploaderName}.SHA256SUM`),
], async (err, verifyResult) => {
if (err) {
setFailure('Codecov: Error importing pgp key', failCi);
].join(' ');
try {
await execSync(command, {stdio: 'inherit'});
} catch (err) {
setFailure(`Codecov: Error verifying gpg signature: ${err.message}`, failCi);
}
core.info(verifyResult);
await validateSha();
});
};
// Import gpg key
gpg.call('', [
const importKey = async () => {
const command = [
'gpg',
'--logger-fd',
'1',
'--no-default-keyring',
'--import',
path.join(__dirname, 'pgp_keys.asc'),
], async (err, importResult) => {
if (err) {
setFailure('Codecov: Error importing pgp key', failCi);
].join(' ');
try {
await execSync(command, {stdio: 'inherit'});
} catch (err) {
setFailure(`Codecov: Error importing gpg key: ${err.message}`, failCi);
}
core.info(importResult);
verifySignature();
});
};
await importKey();
await verifySignature();
await validateSha();
} catch (err) {
setFailure(`Codecov: Error validating uploader: ${err.message}`, failCi);
}

View File

@@ -3,14 +3,12 @@ import {request} from 'undici';
const versionInfo = async (
platform: string,
version?: string,
version: string,
): Promise<void> => {
if (version) {
core.info(`==> Running version ${version}`);
}
try {
const metadataRes = await request(`https://cli.codecov.io/${platform}/latest`, {
const metadataRes = await request(`https://cli.codecov.io/${platform}/${version}`, {
headers: {'Accept': 'application/json'},
});
const metadata = await metadataRes.body.json();