Compare commits

...

148 Commits
v1.0.1 ... v1.1

Author SHA1 Message Date
Jonas Bushart
50559e3f2c Update cargo-audit to 0.20.0 2024-02-18 16:20:11 +01:00
Jonas Bushart
27b62ea8ec Merge pull request #67 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2024-02-12 19:01:22 +01:00
pre-commit-ci[bot]
e207bcd5c9 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.27.4 → 0.28.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.27.4...0.28.0)
2024-02-12 17:24:18 +00:00
Jonas Bushart
7d76eb83b1 Merge pull request #66 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2024-02-05 19:05:28 +01:00
pre-commit-ci[bot]
3e63858e0b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.27.3 → 0.27.4](https://github.com/python-jsonschema/check-jsonschema/compare/0.27.3...0.27.4)
2024-02-05 17:22:30 +00:00
Jonas Bushart
5308f89d29 Update cargo-audit to 0.19.0 2024-02-03 22:23:31 +01:00
Jonas Bushart
65c5146921 Merge pull request #63 from lwshang/patch-1 2024-02-03 22:19:25 +01:00
Jonas Bushart
6e072ef47a Merge pull request #64 from actions-rust-lang/pre-commit-ci-update-config 2024-01-29 18:30:09 +01:00
pre-commit-ci[bot]
8001bc456e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-29 17:26:11 +00:00
pre-commit-ci[bot]
cbfe81d58f [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1)
2024-01-29 17:26:02 +00:00
Linwei Shang
89b10d9af6 Upgrade actions/cache to v4
GitHub is deprecating node16 (cache@v3 using).
2024-01-26 14:40:23 -05:00
Jonas Bushart
61ccdfe0c5 Merge pull request #62 from actions-rust-lang/more-debug-logging 2024-01-20 00:28:36 +01:00
Jonas Bushart
959eb6cc5c Update changelog 2024-01-20 00:23:38 +01:00
Jonas Bushart
96eb2dcbe4 Generate lockfile when not existing
Whenever the `file` argument is set give, then cargo audit will not generate the file if it doesn't exist
2024-01-19 23:59:25 +01:00
Jonas Bushart
6943412b48 Add some debug logging for cargo audit 2024-01-19 23:28:36 +01:00
Jonas Bushart
9c29543ade Prepare release 1.1.11 2024-01-18 21:24:19 +01:00
Jonas Bushart
dd7ccfd1ab Merge pull request #56 from mbergkvist/update-permission-example 2024-01-18 21:19:51 +01:00
Jonas Bushart
70c2c66eb8 Merge pull request #61 from actions-rust-lang/pre-commit-ci-update-config 2023-12-25 23:06:34 +01:00
pre-commit-ci[bot]
dfa1ce2e0a [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.12.0 → 23.12.1](https://github.com/psf/black/compare/23.12.0...23.12.1)
- [github.com/pre-commit/mirrors-mypy: v1.7.1 → v1.8.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.1...v1.8.0)
2023-12-25 17:27:46 +00:00
Jonas Bushart
0c92230a3a Merge pull request #60 from actions-rust-lang/pre-commit-ci-update-config 2023-12-20 00:50:37 +01:00
pre-commit-ci[bot]
170a3db2a9 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.11.0 → 23.12.0](https://github.com/psf/black/compare/23.11.0...23.12.0)
- [github.com/PyCQA/isort: 5.13.0 → 5.13.2](https://github.com/PyCQA/isort/compare/5.13.0...5.13.2)
2023-12-18 17:29:43 +00:00
Jonas Bushart
656c0afdef Merge pull request #55 from mbergkvist/add-file-input 2023-12-15 22:15:33 +01:00
Jonas Bushart
ff8437a517 Merge pull request #59 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-12-11 18:50:23 +01:00
pre-commit-ci[bot]
8d10929ca1 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/isort: 5.12.0 → 5.13.0](https://github.com/PyCQA/isort/compare/5.12.0...5.13.0)
- [github.com/python-jsonschema/check-jsonschema: 0.27.2 → 0.27.3](https://github.com/python-jsonschema/check-jsonschema/compare/0.27.2...0.27.3)
2023-12-11 17:27:10 +00:00
Jonas Bushart
e46b8c0d76 Merge pull request #58 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-11-27 20:40:36 +01:00
pre-commit-ci[bot]
7b3777bcef [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.7.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.0...v1.7.1)
- [github.com/python-jsonschema/check-jsonschema: 0.27.1 → 0.27.2](https://github.com/python-jsonschema/check-jsonschema/compare/0.27.1...0.27.2)
2023-11-27 17:21:20 +00:00
Jonas Bushart
2ed876b7ce Merge pull request #57 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-11-21 20:52:28 +01:00
pre-commit-ci[bot]
69f891a4a1 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0)
- [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.0)
2023-11-13 17:29:11 +00:00
Markus Bergkvist
d5ad8c50af Update README example
The write permission on issues in the job sets all other scopes to 'none',
including the global 'read-all', so the action failed on code check-out.
Instead, set the permission for the job, also reduce it to content since
that is all what is required.
2023-11-11 13:38:56 +01:00
Markus Bergkvist
681351af46 Add optional input for Cargo lockfile 2023-11-11 13:02:39 +01:00
Jonas Bushart
d974e8cc12 Merge pull request #54 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-11-07 09:31:49 +01:00
pre-commit-ci[bot]
211345ef5d [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.27.0 → 0.27.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.27.0...0.27.1)
2023-11-06 17:21:16 +00:00
Jonas Bushart
001355d0d6 Update CHANGELOG.md 2023-11-02 08:28:22 +01:00
Jonas Bushart
f3073563ad Merge pull request #52 from autarch/patch-1
Use actions/cache@v3, not v4
2023-11-02 08:26:59 +01:00
Dave Rolsky
fe37c9c299 Use actions/cache@v3, not v4
I'm not sure how the PR that changed this passed, but AFAICT there's no v4 of `actions/cache`. The latest major version is `v3`.
2023-11-01 20:06:01 -05:00
Jonas Bushart
d691f93a68 Update cargo-audit to 0.18.3 2023-11-01 21:31:26 +01:00
Jonas Bushart
be90b61479 Merge pull request #50 from reedloden/patch-1 2023-11-01 21:27:34 +01:00
Jonas Bushart
b4cfb1363f Merge pull request #51 from actions-rust-lang/pre-commit-ci-update-config 2023-11-01 21:27:15 +01:00
pre-commit-ci[bot]
6628342aa6 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.10.0 → 23.10.1](https://github.com/psf/black/compare/23.10.0...23.10.1)
2023-10-30 17:23:29 +00:00
Reed Loden
c6ef88d85a Bump to actions/cache@v4
Node16.x is deprecated, so bump to newer version.
2023-10-24 12:33:37 -07:00
Jonas Bushart
a69554ff2e Merge pull request #49 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-10-23 20:45:38 +02:00
pre-commit-ci[bot]
8f7e2d1bd1 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.9.1 → 23.10.0](https://github.com/psf/black/compare/23.9.1...23.10.0)
- [github.com/pre-commit/mirrors-mypy: v1.6.0 → v1.6.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.0...v1.6.1)
2023-10-23 17:28:09 +00:00
Jonas Bushart
44e5adf23b Merge pull request #48 from actions-rust-lang/pre-commit-ci-update-config 2023-10-16 20:58:20 +02:00
pre-commit-ci[bot]
c696842dcb [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.6.0)
2023-10-16 17:21:30 +00:00
Jonas Bushart
3852156fff Merge pull request #47 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-10-09 19:44:00 +02:00
pre-commit-ci[bot]
246a8329c9 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0)
- [github.com/asottile/pyupgrade: v3.13.0 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.13.0...v3.15.0)
2023-10-09 17:30:36 +00:00
Jonas Bushart
fad8f7b7af Update example workflow in readme 2023-10-03 18:56:13 +02:00
Jonas Bushart
799fa87586 Merge pull request #46 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-10-03 16:59:22 +02:00
pre-commit-ci[bot]
677ff77e8c [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.26.3 → 0.27.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.26.3...0.27.0)
2023-10-02 20:14:51 +00:00
Jonas Bushart
0a72dd284e Merge pull request #44 from actions-rust-lang/dependabot/github_actions/actions/checkout-4 2023-10-01 21:59:47 +02:00
dependabot[bot]
672ca0693e Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 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/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 18:45:53 +00:00
Jonas Bushart
7feab04f1a Merge pull request #43 from actions-rust-lang/pre-commit-ci-update-config 2023-09-25 23:56:42 +02:00
pre-commit-ci[bot]
feb1d0bdca [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.10.1 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.13.0)
2023-09-25 20:19:19 +00:00
Jonas Bushart
7e6721cf40 Merge pull request #42 from actions-rust-lang/pre-commit-ci-update-config 2023-09-11 22:26:33 +02:00
pre-commit-ci[bot]
660e5d19a6 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1)
2023-09-11 20:16:33 +00:00
Jonas Bushart
19016ced74 Merge pull request #41 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-08-28 22:27:17 +02:00
pre-commit-ci[bot]
4af958f59b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.24.1 → 0.26.3](https://github.com/python-jsonschema/check-jsonschema/compare/0.24.1...0.26.3)
2023-08-28 19:43:54 +00:00
Jonas Bushart
2dc31fb5ef Add changelog entry 2023-08-23 19:17:52 +02:00
Jonas Bushart
ca4f182e86 Be more robust in handling missing data from RUSTSEC advisory
Closes #40
2023-08-23 19:16:59 +02:00
Jonas Bushart
19c45e9a43 Merge pull request #39 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-08-22 08:09:02 +02:00
pre-commit-ci[bot]
22e7edaffe [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.5.0 → v1.5.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.0...v1.5.1)
2023-08-21 19:54:32 +00:00
Jonas Bushart
c367d7a394 Merge pull request #38 from actions-rust-lang/pre-commit-ci-update-config 2023-08-14 22:14:21 +02:00
pre-commit-ci[bot]
d8f9adf642 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.4.1...v1.5.0)
- [github.com/python-jsonschema/check-jsonschema: 0.23.3 → 0.24.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.23.3...0.24.1)
2023-08-14 19:51:41 +00:00
Jonas Bushart
2d2ada1a62 Merge pull request #37 from actions-rust-lang/pre-commit-ci-update-config 2023-07-31 22:18:40 +02:00
pre-commit-ci[bot]
73e05e72a7 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.9.0 → v3.10.1](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.10.1)
2023-07-31 20:02:47 +00:00
Jonas Bushart
ce625a3fb1 Merge pull request #36 from actions-rust-lang/pre-commit-ci-update-config 2023-07-17 22:39:17 +02:00
pre-commit-ci[bot]
0273520156 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.3.0 → 23.7.0](https://github.com/psf/black/compare/23.3.0...23.7.0)
- [github.com/python-jsonschema/check-jsonschema: 0.23.2 → 0.23.3](https://github.com/python-jsonschema/check-jsonschema/compare/0.23.2...0.23.3)
2023-07-17 20:01:12 +00:00
Jonas Bushart
01252679fb Merge pull request #35 from actions-rust-lang/pre-commit-ci-update-config 2023-07-10 22:08:25 +02:00
pre-commit-ci[bot]
0ea49bd8cb [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.8.0 → v3.9.0](https://github.com/asottile/pyupgrade/compare/v3.8.0...v3.9.0)
2023-07-10 19:43:24 +00:00
Jonas Bushart
b91ce6d80f Merge pull request #34 from actions-rust-lang/pre-commit-ci-update-config 2023-07-03 22:32:21 +02:00
pre-commit-ci[bot]
3f91ab5f83 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.7.0 → v3.8.0](https://github.com/asottile/pyupgrade/compare/v3.7.0...v3.8.0)
2023-07-03 19:38:34 +00:00
Jonas Bushart
debd2dd3cc Merge pull request #32 from actions-rust-lang/pre-commit-ci-update-config 2023-06-26 21:30:01 +02:00
pre-commit-ci[bot]
64f6d2e350 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.3.0...v1.4.1)
2023-06-26 19:21:16 +00:00
Jonas Bushart
87ce76a59f Merge pull request #31 from actions-rust-lang/pre-commit-ci-update-config 2023-06-19 21:59:43 +02:00
pre-commit-ci[bot]
f3aaeb714e [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.6.0 → v3.7.0](https://github.com/asottile/pyupgrade/compare/v3.6.0...v3.7.0)
- [github.com/python-jsonschema/check-jsonschema: 0.23.1 → 0.23.2](https://github.com/python-jsonschema/check-jsonschema/compare/0.23.1...0.23.2)
2023-06-19 19:42:59 +00:00
Jonas Bushart
d13447f935 Merge pull request #30 from actions-rust-lang/pre-commit-ci-update-config 2023-06-12 22:00:31 +02:00
pre-commit-ci[bot]
bdd908fe01 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.4.0 → v3.6.0](https://github.com/asottile/pyupgrade/compare/v3.4.0...v3.6.0)
2023-06-12 19:25:25 +00:00
Jonas Bushart
3164457fe4 Merge pull request #29 from actions-rust-lang/pre-commit-ci-update-config 2023-06-05 21:15:19 +02:00
pre-commit-ci[bot]
023bfd076f [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.23.0 → 0.23.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.23.0...0.23.1)
2023-06-05 19:12:09 +00:00
Jonas Bushart
5e37004d2c Merge pull request #28 from actions-rust-lang/pre-commit-ci-update-config 2023-05-16 17:00:06 +02:00
pre-commit-ci[bot]
06034075ba [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.2.0 → v1.3.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.2.0...v1.3.0)
2023-05-15 19:14:54 +00:00
Jonas Bushart
fe269d550e Update cargo-audit to 0.17.6 2023-05-12 22:05:27 +02:00
Jonas Bushart
b6da146557 Merge pull request #27 from actions-rust-lang/pre-commit-ci-update-config 2023-05-08 22:21:23 +02:00
pre-commit-ci[bot]
e661f5f79f [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.3.2 → v3.4.0](https://github.com/asottile/pyupgrade/compare/v3.3.2...v3.4.0)
- [github.com/python-jsonschema/check-jsonschema: 0.22.0 → 0.23.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.22.0...0.23.0)
2023-05-08 19:32:55 +00:00
Jonas Bushart
6c5b44595d Merge pull request #26 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-05-01 23:08:15 +02:00
pre-commit-ci[bot]
b4f705152a [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.3.1 → v3.3.2](https://github.com/asottile/pyupgrade/compare/v3.3.1...v3.3.2)
2023-05-01 19:24:23 +00:00
Jonas Bushart
38e4be49ce Merge pull request #25 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-04-11 06:01:20 +03:00
pre-commit-ci[bot]
c93937eff7 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.1.1 → v1.2.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.1.1...v1.2.0)
2023-04-10 19:18:55 +00:00
Jonas Bushart
b890df83b8 Merge pull request #24 from actions-rust-lang/pre-commit-ci-update-config 2023-04-03 22:12:59 +02:00
pre-commit-ci[bot]
8d89530feb [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.1.0 → 23.3.0](https://github.com/psf/black/compare/23.1.0...23.3.0)
2023-04-03 19:54:37 +00:00
Jonas Bushart
7e63792ca8 Update cargo-audit to 0.17.5 2023-03-24 20:14:05 +01:00
Jonas Bushart
229220ba5c Merge pull request #23 from actions-rust-lang/pre-commit-ci-update-config 2023-03-13 21:59:19 +01:00
pre-commit-ci[bot]
0fd4d6ceb9 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.0.1 → v1.1.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.1...v1.1.1)
- [github.com/python-jsonschema/check-jsonschema: 0.21.0 → 0.22.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.21.0...0.22.0)
2023-03-13 19:27:32 +00:00
Jonas Bushart
26cc152162 Merge pull request #22 from actions-rust-lang/pre-commit-ci-update-config 2023-02-20 20:16:44 +01:00
pre-commit-ci[bot]
839e077185 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.0.0 → v1.0.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.0...v1.0.1)
2023-02-20 19:03:41 +00:00
Jonas Bushart
a4304b40f7 Check the syntax of GitHub Actions and Workflows files 2023-02-13 20:17:27 +01:00
Jonas Bushart
de4a880f36 Merge pull request #21 from actions-rust-lang/pre-commit-ci-update-config 2023-02-13 20:15:08 +01:00
pre-commit-ci[bot]
60557a6189 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.991 → v1.0.0](https://github.com/pre-commit/mirrors-mypy/compare/v0.991...v1.0.0)
2023-02-13 19:09:15 +00:00
Jonas Bushart
fc8955c20d Merge pull request #20 from actions-rust-lang/pre-commit-ci-update-config 2023-02-06 21:01:58 +01:00
pre-commit-ci[bot]
5e0c395775 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)
2023-02-06 19:35:04 +00:00
Jonas Bushart
362dc829f3 Merge pull request #19 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-01-30 21:12:36 +01:00
pre-commit-ci[bot]
ea1aefd179 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/isort: 5.11.4 → 5.12.0](https://github.com/PyCQA/isort/compare/5.11.4...5.12.0)
2023-01-30 19:23:47 +00:00
Jonas Bushart
0d6847edc7 Merge pull request #18 from actions-rust-lang/pre-commit-ci-update-config 2022-12-26 20:33:51 +01:00
pre-commit-ci[bot]
058839aa82 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/isort: v5.11.3 → 5.11.4](https://github.com/PyCQA/isort/compare/v5.11.3...5.11.4)
2022-12-26 18:55:00 +00:00
Jonas Bushart
165ccb4a64 Prepare new version to fix duplicate issues for yanked crates 2022-12-22 23:09:27 +01:00
Jonas Bushart
623cff7dbe Fix finding of existing issues, since the issue title format was expanded
Issues for yanked crates start with "Crate ... v..." not with
"RUSTSEC-". So the filter on the existing issues list was too strict,
not detecting the issue for yanked crates. This causes duplicate issues.
2022-12-22 22:44:56 +01:00
Jonas Bushart
2406ebfa1e Prepare new version v1.1.4
Closes #17
2022-12-22 22:00:04 +01:00
Jonas Bushart
bbbc43cd45 Add icon to markdown summary for yanked crates 2022-12-22 21:51:32 +01:00
Jonas Bushart
44f419d83a Handle that the advisory field is optional
If missing show a message that the crate is yanked
2022-12-22 21:42:26 +01:00
Jonas Bushart
bf3d0bcece Add some debug statements
This should make future debugging requests easier, since the cargo audit
command and the resulting JSON are directly accessible.
2022-12-22 21:33:06 +01:00
Jonas Bushart
cf4c31eba1 Merge pull request #16 from actions-rust-lang/pre-commit-ci-update-config 2022-12-19 19:43:10 +01:00
pre-commit-ci[bot]
13b59a5eab [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/isort: 5.10.1 → v5.11.3](https://github.com/PyCQA/isort/compare/5.10.1...v5.11.3)
2022-12-19 18:33:35 +00:00
Jonas Bushart
502e7e5028 Merge pull request #15 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-12-12 20:01:18 +01:00
pre-commit-ci[bot]
8ee9b53721 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.10.0 → 22.12.0](https://github.com/psf/black/compare/22.10.0...22.12.0)
- [github.com/asottile/pyupgrade: v3.3.0 → v3.3.1](https://github.com/asottile/pyupgrade/compare/v3.3.0...v3.3.1)
2022-12-12 18:48:16 +00:00
Jonas Bushart
2c37721442 Add timeout arguments to network functions
This fixes a pylint warning
2022-12-05 22:22:46 +00:00
Jonas Bushart
65677fab72 Release version with caching fixes 2022-12-05 22:04:42 +00:00
Jonas Bushart
8de7e6de94 Remove duplicate bin/ 2022-12-05 21:00:24 +00:00
Jonas Bushart
a1194263c1 Fix the path for cache action 2022-12-05 20:06:33 +00:00
Jonas Bushart
88907a355a Merge pull request #14 from actions-rust-lang/pre-commit-ci-update-config 2022-12-05 19:45:55 +01:00
pre-commit-ci[bot]
568294585d [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.2.2 → v3.3.0](https://github.com/asottile/pyupgrade/compare/v3.2.2...v3.3.0)
2022-12-05 18:31:12 +00:00
Jonas Bushart
ec48ef0b45 Merge pull request #13 from actions-rust-lang/pre-commit-ci-update-config 2022-11-28 21:14:03 +01:00
pre-commit-ci[bot]
b8f4057e9c [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0)
2022-11-28 19:00:41 +00:00
Jonas Bushart
92881e10cb Merge pull request #12 from actions-rust-lang/pre-commit-ci-update-config 2022-11-21 20:17:04 +01:00
pre-commit-ci[bot]
ece2fac1af [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.990 → v0.991](https://github.com/pre-commit/mirrors-mypy/compare/v0.990...v0.991)
2022-11-21 18:16:37 +00:00
Jonas Bushart
16d3c44a77 Merge pull request #11 from actions-rust-lang/pre-commit-ci-update-config 2022-11-14 19:34:37 +01:00
pre-commit-ci[bot]
3164ded2e4 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.2.0 → v3.2.2](https://github.com/asottile/pyupgrade/compare/v3.2.0...v3.2.2)
- [github.com/pre-commit/mirrors-mypy: v0.982 → v0.990](https://github.com/pre-commit/mirrors-mypy/compare/v0.982...v0.990)
2022-11-14 18:23:14 +00:00
Jonas Bushart
34b262c4ff Bump cargo-audit to 0.17.4 2022-11-09 18:14:33 +01:00
Jonas Bushart
585ac71b19 Merge pull request #10 from actions-rust-lang/pre-commit-ci-update-config 2022-10-31 21:51:12 +01:00
pre-commit-ci[bot]
ef659d2397 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.1.0 → v3.2.0](https://github.com/asottile/pyupgrade/compare/v3.1.0...v3.2.0)
2022-10-31 18:25:48 +00:00
Jonas Bushart
919e90c805 Merge pull request #9 from actions-rust-lang/pre-commit-ci-update-config 2022-10-17 21:07:45 +02:00
pre-commit-ci[bot]
a7fc2f648c [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.0.0 → v3.1.0](https://github.com/asottile/pyupgrade/compare/v3.0.0...v3.1.0)
2022-10-17 18:17:22 +00:00
Jonas Bushart
5172a3ea85 Switch from set-output to $GITHUB_OUTPUT
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2022-10-13 20:57:51 +02:00
Jonas Bushart
330429446f Merge pull request #8 from actions-rust-lang/pre-commit-ci-update-config 2022-10-10 21:18:28 +02:00
pre-commit-ci[bot]
c2cbc39d10 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0)
- [github.com/asottile/pyupgrade: v2.38.2 → v3.0.0](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.0.0)
- [github.com/pre-commit/mirrors-mypy: v0.981 → v0.982](https://github.com/pre-commit/mirrors-mypy/compare/v0.981...v0.982)
2022-10-10 18:32:56 +00:00
Jonas Bushart
74931db5cd Merge pull request #7 from actions-rust-lang/pre-commit-ci-update-config 2022-10-03 20:28:23 +02:00
pre-commit-ci[bot]
5d7f19dca3 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.971 → v0.981](https://github.com/pre-commit/mirrors-mypy/compare/v0.971...v0.981)
2022-10-03 18:06:24 +00:00
Jonas Bushart
5145399af2 Merge pull request #6 from actions-rust-lang/pre-commit-ci-update-config 2022-09-26 20:26:57 +02:00
pre-commit-ci[bot]
bef751aae3 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.38.0 → v2.38.2](https://github.com/asottile/pyupgrade/compare/v2.38.0...v2.38.2)
2022-09-26 18:15:28 +00:00
Jonas Bushart
f62ab55884 Merge pull request #5 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-09-19 21:56:36 +02:00
pre-commit-ci[bot]
71ed029bec [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.37.3 → v2.38.0](https://github.com/asottile/pyupgrade/compare/v2.37.3...v2.38.0)
2022-09-19 18:17:15 +00:00
Jonas Bushart
90988942a7 Merge pull request #4 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-09-06 12:49:18 +02:00
pre-commit-ci[bot]
ac36165976 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.6.0 → 22.8.0](https://github.com/psf/black/compare/22.6.0...22.8.0)
2022-09-05 18:14:32 +00:00
Jonas Bushart
59b495571e Better example workflow
Include more trigger condition in the example workflow.
2022-08-15 15:50:35 +02:00
Jonas Bushart
64aafa27ea Prevent GitHub from autolinking usernames 2022-08-14 16:29:35 +00:00
Jonas Bushart
b49c8648ab Update Action name and description 2022-08-14 16:22:39 +00:00
Jonas Bushart
2f313e5d05 Better explain informational_warnings and how cargo audit handles them
Setting denyWarnings will pass that flag to cargo audit.

Closes #3
2022-08-14 16:21:03 +00:00
Jonas Bushart
037e5da0c0 Present aliases to the Rustsec IDs
The overview table will now show aliases and related advisories.

Closes #1
2022-08-14 16:14:05 +00:00
Jonas Bushart
bc29d560db Slight description tweak 2022-08-09 23:13:11 +02:00
6 changed files with 316 additions and 61 deletions

View File

@@ -15,11 +15,11 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
echo "current_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
shell: bash
- name: Create and push tags
run: |

View File

@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-case-conflict
@@ -14,19 +14,25 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.13.2
# https://github.com/psf/black/blob/main/docs/guides/using_black_with_other_tools.md
hooks:
- id: isort
args: ["--profile=black"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies:
- types-requests
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-dependabot
- id: check-github-actions
- id: check-github-workflows

View File

@@ -7,9 +7,90 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.1.14] - 2024-02-18
* Update `cargo-audit` to 0.20.0
## [1.1.13] - 2024-02-03
* Update `cargo-audit` to 0.19.0
## [1.1.12] - 2024-01-20
* Fix default of `file` argument to make it work again for repositories without `Cargo.lock` checked in.
## [1.1.11] - 2024-01-18
* Allow specifying the path to the `Cargo.lock` file, in case it is not in the root of the repository (#55)
* Update the example in the readme, to have the correct permissions for private repositories.
## [1.1.10] - 2023-11-02
* Fix running the action, by using the correct version of the cache action.
## [1.1.9] - 2023-11-01
* Update `cargo-audit` to 0.18.3
## [1.1.8] - 2023-08-23
* Handle missing data in advisories better to prevent crashing (#40)
## [1.1.7] - 2023-05-12
* Update `cargo-audit` to 0.17.6
## [1.1.6] - 2023-03-24
* Update `cargo-audit` to 0.17.5
## [1.1.5] - 2022-12-22
* Fix duplicate issues for yanked crates.
The previous version introduced a bug where existing issues were not properly detected.
This only affected issues for yanked crates.
Now duplicate issues will no longer be created.
## [1.1.4] - 2022-12-22
* Handle warnings without any associated advisory.
This occurs for yanked crates, where the `advisory` field is `null` in the JSON output.
Now a message is shown that the crate and version is yanked.
## [1.1.3] - 2022-12-05
* Fix the path to the cargo installation directory to fix caching.
## [1.1.2] - 2022-11-09
### Changed
* Update `cargo-audit` to 0.17.4 which fixes checking for yanked crates.
## [1.1.1] - 2022-10-13
### Changed
* Switch from set-output to $GITHUB_OUTPUT to avoid warning
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
## [1.1.0] - 2022-08-14
### Added
* Present aliases for the RustSec ID and related advisories in the overview table (#1).
### Changed
* Setting `denyWarnings` will now pass `--deny warnings` to cargo audit.
## [1.0.1] - 2022-08-09
Create proper release tags.
### Added
* Create proper release tags.
## [1.0.0] - 2022-08-09

View File

@@ -13,20 +13,27 @@ name: "Audit Dependencies"
on:
push:
paths:
# Run if workflow changes
- '.github/workflows/audit.yml'
# Run on changed dependencies
- '**/Cargo.toml'
- '**/Cargo.lock'
# Run if the configuration file changes
- '**/audit.toml'
# Rerun periodicly to pick up new advisories
schedule:
- cron: '0 0 * * *'
permissions: read-all
# Run manually
workflow_dispatch:
jobs:
audit:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/audit@v1
name: Audit Rust Dependencies
with:
@@ -38,11 +45,15 @@ jobs:
All inputs are optional.
Consider adding a [`audit.toml` configuration file] to your repository for further configurations.
cargo audit supports multiple warning types, such as unsound code or yanked crates.
Configuration is only possible via the `informational_warnings` parameter in the configuration file ([#318](https://github.com/rustsec/rustsec/issues/318)).
Setting `denyWarnings` to true will also enable these warnings, but each warning is upgraded to an error.
| Name | Description | Default |
| -------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| `TOKEN` | The GitHub access token to allow us to retrieve, create and update issues (automatically set). | `github.token` |
| `denyWarnings` | Any warnings generated will be treated as an error and fail the action. | false |
| `file` | The path to the Cargo.lock file. | |
| `ignore` | A comma separated list of Rustsec IDs to ignore. | |
| `createIssues` | Create/Update issues for each found vulnerability. By default only on `main` or `master` branch. | `github.ref == 'refs/heads/master' \|\| github.ref == 'refs/heads/main'` |

View File

@@ -1,6 +1,6 @@
name: Audit Rust Dependencies
name: cargo audit your Rust Dependencies
description: |
Audit Rust dependencies for vulnerabilities or outdated dependencies.
Audit Rust dependencies with cargo audit and the RustSec Advisory DB
branding:
icon: "shield"
color: "red"
@@ -14,6 +14,10 @@ inputs:
description: "Any warnings generated will be treated as an error and fail the action"
required: false
default: "false"
file:
description: "Cargo lockfile to inspect"
required: false
default: ""
ignore:
description: "A comma separated list of Rustsec IDs to ignore"
required: false
@@ -26,19 +30,23 @@ inputs:
runs:
using: composite
steps:
- uses: actions/cache@v3
- name: Identify cargo installation directory
run: echo "cargohome=${CARGO_HOME:-$HOME/.cargo}" >> $GITHUB_OUTPUT
shell: bash
id: cargo-home
- uses: actions/cache@v4
id: cache
with:
path: |
${{ env.CARGO_HOME }}/.cargo/bin/cargo-audit*
${{ env.CARGO_HOME }}/.cargo/.crates.toml
${{ env.CARGO_HOME }}/.cargo/.crates2.json
key: cargo-audit-v0.17.0
${{ steps.cargo-home.outputs.cargohome }}/bin/cargo-audit*
${{ steps.cargo-home.outputs.cargohome }}/.crates.toml
${{ steps.cargo-home.outputs.cargohome }}/.crates2.json
key: cargo-audit-v0.20.0
- name: Install cargo-audit
if: steps.cache.outputs.cache-hit != 'true'
# Update both this version number and the cache key
run: cargo install cargo-audit --vers 0.17.0
run: cargo install cargo-audit --vers 0.20.0 --no-default-features
shell: bash
- run: |
@@ -48,6 +56,7 @@ runs:
env:
INPUT_CREATE_ISSUES: ${{ inputs.createIssues }}
INPUT_DENY_WARNINGS: ${{ inputs.denyWarnings }}
INPUT_FILE: ${{ inputs.file }}
INPUT_IGNORE: ${{ inputs.ignore }}
INPUT_TOKEN: ${{ inputs.TOKEN }}
PYTHONPATH: ${{ github.action_path }}

232
audit.py
View File

@@ -11,6 +11,15 @@ import requests
# https://github.com/alstr/todo-to-issue-action/blob/25c80e9c4999d107bec208af49974d329da26370/main.py
# Originally licensed under MIT license
# Timeout in seconds for requests methods
TIMEOUT = 30
def debug(message: str) -> None:
"""Print a debug message to the GitHub Action log"""
newline = "\n"
print(f"""::debug::{message.replace(newline, " ")}""")
class Issue:
"""Basic Issue model for collecting the necessary info to send to GitHub."""
@@ -21,7 +30,7 @@ class Issue:
labels: List[str],
assignees: List[str],
body: str,
rustsec_id: str,
rustsec_id: str, # Should be the start of the title
) -> None:
self.title = title
self.labels = labels
@@ -59,58 +68,166 @@ class Entry:
self.entry_type = entry_type
self.warning_type = warning_type
def _entry_table(self) -> str:
advisory = self.entry["advisory"]
def id(self) -> str:
"""
Return the ID of the entry.
"""
if self.warning_type is None:
warning = ""
# IMPORTANT: Coordinate this value with the `_get_existing_issues` method below.
# Any value returned here must also be present in the filtering there, since the id will be used in the issue title.
advisory = self.entry.get("advisory", None)
if advisory:
return advisory["id"]
else:
warning = f"\n| Warning | {self.warning_type} |"
unaffected = " OR ".join(self.entry["versions"]["unaffected"])
if unaffected != "":
unaffected = f"\n| Unaffected Versions | `{unaffected}` |"
patched = " OR ".join(self.entry["versions"]["patched"])
if patched == "":
patched = "n/a"
return f"Crate {self.entry['package']['name']} {self.entry['package']['version']}"
def _entry_table(self) -> str:
advisory = self.entry.get("advisory", None)
if advisory:
table = []
table.append(("Details", ""))
table.append(("---", "---"))
table.append(("Package", f"`{advisory['package']}`"))
table.append(("Version", f"`{self.entry['package']['version']}`"))
if self.warning_type is not None:
table.append(("Warning", str(self.warning_type)))
table.append(("URL", advisory["url"]))
table.append(
(
"Patched Versions",
(
" OR ".join(self.entry["versions"]["patched"])
if len(self.entry["versions"]["patched"]) > 0
else "n/a"
),
)
)
if len(self.entry["versions"]["unaffected"]) > 0:
table.append(
(
"Unaffected Versions",
" OR ".join(self.entry["versions"]["unaffected"]),
)
)
if len(advisory["aliases"]) > 0:
table.append(
(
"Aliases",
", ".join(
Entry._md_autolink_advisory_id(advisory_id)
for advisory_id in advisory["aliases"]
),
)
)
if len(advisory["related"]) > 0:
table.append(
(
"Related Advisories",
", ".join(
Entry._md_autolink_advisory_id(advisory_id)
for advisory_id in advisory["related"]
),
)
)
table_parts = []
for row in table:
table_parts.append("| ")
if row[0] is not None:
table_parts.append(row[0])
table_parts.append(" | ")
if row[1] is not None:
table_parts.append(row[1])
else:
table_parts.append("n/a")
table_parts.append(" |\n")
return "".join(table_parts)
else:
patched = f"`{patched}`"
table = f"""| Details | |
| --- | --- |
| Package | `{advisory['package']}` |
| Version | `{self.entry['package']['version']}` |{warning}
| URL | <{advisory['url']}> |
| Patched Versions | {patched} |{unaffected}
# There is no advisory.
# This occurs when a yanked version is detected.
name = self.entry["package"]["name"]
return f"""{self.id()} is yanked.
Switch to a different version of `{name}` to resolve this issue.
"""
return table
@classmethod
def _md_autolink_advisory_id(cls, advisory_id: str) -> str:
"""
If a supported advisory format, such as GHSA- is detected, return a markdown link.
Otherwise return the ID as text.
"""
if advisory_id.startswith("GHSA-"):
return f"[{advisory_id}](https://github.com/advisories/{advisory_id})"
if advisory_id.startswith("CVE-"):
return f"[{advisory_id}](https://nvd.nist.gov/vuln/detail/{advisory_id})"
if advisory_id.startswith("RUSTSEC-"):
return f"[{advisory_id}](https://rustsec.org/advisories/{advisory_id})"
return advisory_id
def format_as_markdown(self) -> str:
advisory = self.entry["advisory"]
advisory = self.entry.get("advisory", None)
entry_table = self._entry_table()
md = f"""## {self.entry_type.icon()} {advisory['id']}: {advisory['title']}
if advisory:
entry_table = self._entry_table()
# Replace the @ with a ZWJ to avoid triggering markdown autolinks
# Otherwise GitHub will interpret the @ as a mention
description = advisory["description"].replace("@", "@\u200d")
md = f"""## {self.entry_type.icon()} {advisory['id']}: {advisory['title']}
{entry_table}
{advisory['description']}
{description}
"""
return md
else:
# There is no advisory.
# This occurs when a yanked version is detected.
name = self.entry["package"]["name"]
return f"""## {self.entry_type.icon()} {self.id()} is yanked.
Switch to a different version of `{name}` to resolve this issue.
"""
return md
def format_as_issue(self, labels: List[str], assignees: List[str]) -> Issue:
advisory = self.entry["advisory"]
advisory = self.entry.get("advisory", None)
entry_table = self._entry_table()
if advisory:
entry_table = self._entry_table()
title = f"{advisory['id']}: {advisory['title']}"
body = f"""{entry_table}
title = f"{self.id()}: {advisory['title']}"
body = f"""{entry_table}
{advisory['description']}"""
return Issue(
title=title,
labels=labels,
assignees=assignees,
body=body,
rustsec_id=advisory["id"],
)
return Issue(
title=title,
labels=labels,
assignees=assignees,
body=body,
rustsec_id=self.id(),
)
else:
# There is no advisory.
# This occurs when a yanked version is detected.
name = self.entry["package"]["name"]
title = f"{self.id()} is yanked"
body = (
f"""Switch to a different version of `{name}` to resolve this issue."""
)
return Issue(
title=title,
labels=labels,
assignees=assignees,
body=body,
rustsec_id=self.id(),
)
class GitHubClient:
@@ -131,6 +248,10 @@ class GitHubClient:
# Retrieve the existing repo issues now so we can easily check them later.
self._get_existing_issues()
debug("Existing issues:")
for issue in self.existing_issues:
debug(f"* {issue['title']}")
def _get_existing_issues(self, page: int = 1) -> None:
"""Populate the existing issues list."""
params: Dict[str, Union[str, int]] = {
@@ -138,16 +259,17 @@ class GitHubClient:
"page": page,
"state": "open",
}
debug(f"Fetching existing issues from GitHub: {page=}")
list_issues_request = requests.get(
self.issues_url, headers=self.issue_headers, params=params
self.issues_url, headers=self.issue_headers, params=params, timeout=TIMEOUT
)
print(f"DBG: {list_issues_request.status_code=}")
if list_issues_request.status_code == 200:
self.existing_issues.extend(
[
issue
for issue in list_issues_request.json()
if issue["title"].startswith("RUSTSEC-")
or issue["title"].startswith("Crate ")
]
)
links = list_issues_request.links
@@ -157,6 +279,7 @@ class GitHubClient:
def create_issue(self, issue: Issue) -> Optional[int]:
"""Create a dict containing the issue details and send it to GitHub."""
title = issue.title
debug(f"Creating issue: {title=}")
# Check if the current issue already exists - if so, skip it.
# The below is a simple and imperfect check based on the issue title.
@@ -175,9 +298,14 @@ class GitHubClient:
existing_issue["url"],
headers=self.issue_headers,
data=json.dumps(body),
timeout=TIMEOUT,
)
return update_request.status_code
debug(
f"""No existing issue found for "{issue.rustsec_id}". Creating new issue."""
)
new_issue_body = {"title": title, "body": issue.body, "labels": issue.labels}
# We need to check if any assignees/milestone specified exist, otherwise issue creation will fail.
@@ -185,7 +313,9 @@ class GitHubClient:
for assignee in issue.assignees:
assignee_url = f"{self.repos_url}{self.repo}/assignees/{assignee}"
assignee_request = requests.get(
url=assignee_url, headers=self.issue_headers
url=assignee_url,
headers=self.issue_headers,
timeout=TIMEOUT,
)
if assignee_request.status_code == 204:
valid_assignees.append(assignee)
@@ -197,6 +327,7 @@ class GitHubClient:
url=self.issues_url,
headers=self.issue_headers,
data=json.dumps(new_issue_body),
timeout=TIMEOUT,
)
return new_issue_request.status_code
@@ -204,7 +335,10 @@ class GitHubClient:
def close_issue(self, issue: Dict[str, Any]) -> int:
body = {"state": "closed"}
close_request = requests.patch(
issue["url"], headers=self.issue_headers, data=json.dumps(body)
issue["url"],
headers=self.issue_headers,
data=json.dumps(body),
timeout=TIMEOUT,
)
return close_request.status_code
@@ -261,12 +395,26 @@ def run() -> None:
ignore_args.append("--ignore")
ignore_args.append(ign)
extra_args = []
if os.environ["INPUT_DENY_WARNINGS"] == "true":
extra_args.append("--deny")
extra_args.append("warnings")
if os.environ["INPUT_FILE"] != "":
extra_args.append("--file")
extra_args.append(os.environ["INPUT_FILE"])
audit_cmd = ["cargo", "audit", "--json"] + extra_args + ignore_args
debug(f"Running command: {audit_cmd}")
completed = subprocess.run(
["cargo", "audit", "--json"] + ignore_args,
audit_cmd,
capture_output=True,
text=True,
check=False,
)
debug(f"Command return code: {completed.returncode}")
debug(f"Command output: {completed.stdout}")
debug(f"Command error: {completed.stderr}")
data = json.loads(completed.stdout)
summary = create_summary(data)
@@ -300,7 +448,7 @@ def run() -> None:
num_existing_issues = len(gh_client.existing_issues)
for entry in entries:
for ex_issue in gh_client.existing_issues:
if ex_issue["title"].startswith(entry.entry["advisory"]["id"]):
if ex_issue["title"].startswith(entry.id()):
gh_client.existing_issues.remove(ex_issue)
num_old_issues = len(gh_client.existing_issues)
print(