Compare commits

...

20 Commits

Author SHA1 Message Date
Jonas Bushart
579aeab71c Update cargo audit to 0.21.2 2025-03-03 21:34:36 +01:00
Jonas Bushart
0a7806b229 Merge pull request #105 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-03-03 18:33:26 +01:00
pre-commit-ci[bot]
4fb4af0611 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/isort: 6.0.0 → 6.0.1](https://github.com/PyCQA/isort/compare/6.0.0...6.0.1)
2025-03-03 17:19:00 +00:00
Jonas Bushart
1aae8517bc Merge pull request #104 from actions-rust-lang/pre-commit-ci-update-config 2025-02-24 19:21:08 +01:00
pre-commit-ci[bot]
202eeee8b4 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.31.1 → 0.31.2](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.1...0.31.2)
2025-02-24 17:11:08 +00:00
Jonas Bushart
34bae80559 Merge pull request #103 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-02-10 21:47:41 +01:00
pre-commit-ci[bot]
23dacfdca9 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.14.1 → v1.15.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.14.1...v1.15.0)
2025-02-10 17:31:28 +00:00
Jonas Bushart
dafa32a4e4 Merge pull request #102 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-02-03 19:22:02 +01:00
pre-commit-ci[bot]
06105d122a [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 24.10.0 → 25.1.0](https://github.com/psf/black/compare/24.10.0...25.1.0)
- [github.com/PyCQA/isort: 5.13.2 → 6.0.0](https://github.com/PyCQA/isort/compare/5.13.2...6.0.0)
- [github.com/python-jsonschema/check-jsonschema: 0.31.0 → 0.31.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.0...0.31.1)
2025-02-03 17:40:45 +00:00
Jonas Bushart
af2ca4abcf Merge pull request #101 from actions-rust-lang/pre-commit-ci-update-config 2025-01-15 18:19:25 +01:00
pre-commit-ci[bot]
de806b6f80 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.30.0...0.31.0)
2025-01-13 17:30:39 +00:00
Jonas Bushart
e12665dbfb Merge pull request #100 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-01-06 19:18:09 +01:00
pre-commit-ci[bot]
fdc8c6b8ea [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.14.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.14.0...v1.14.1)
2025-01-06 17:40:28 +00:00
Jonas Bushart
42ea4d34ab Merge pull request #99 from actions-rust-lang/pre-commit-ci-update-config 2024-12-23 18:55:47 +01:00
pre-commit-ci[bot]
b4380b6dac [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.19.0 → v3.19.1](https://github.com/asottile/pyupgrade/compare/v3.19.0...v3.19.1)
- [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.0)
2024-12-23 17:35:08 +00:00
Jonas Bushart
96e0e19d75 Add Changelog entry for new version 2024-12-17 23:41:46 +01:00
Jonas Bushart
d57b2706e6 Some cleanups and typo fixes 2024-12-17 23:41:37 +01:00
Jonas Bushart
6028f82778 Show a better error message when running "cargo audit" fails
Instead of showing a JSONDecodeError print the exit code, stdout, and
stderr visible in the output.

Closes #98
2024-12-17 23:31:44 +01:00
Jonas Bushart
5bcf9487c7 Merge pull request #97 from actions-rust-lang/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2024-12-02 20:07:21 +01:00
pre-commit-ci[bot]
165f86c1a6 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.29.4 → 0.30.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.29.4...0.30.0)
2024-12-02 17:39:23 +00:00
4 changed files with 46 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -14,24 +14,24 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.1
# 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: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.15.0
hooks:
- id: mypy
additional_dependencies:
- types-requests
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.31.2
hooks:
- id: check-dependabot
- id: check-github-actions

View File

@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.2.4] - 2025-03-03
* Update `cargo-audit` to 0.21.2
## [1.2.3] - 2024-12-17
* Show a better error message when running "cargo audit" fails #98
## [1.2.2] - 2024-11-06
* Update `cargo-audit` to 0.21.0
@@ -35,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [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.
* Update the example in the README, to have the correct permissions for private repositories.
## [1.1.10] - 2023-11-02

View File

@@ -45,12 +45,12 @@ runs:
${{ 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.21.0
key: cargo-audit-v0.21.2
- 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.21.0 --no-default-features
run: cargo install cargo-audit --vers 0.21.2 --no-default-features
shell: bash
- run: |

View File

@@ -7,18 +7,32 @@ from typing import Any, Dict, List, Optional, Union
import requests
# GitHub API CLient copied and adapted from
# GitHub API Client copied and adapted from
# 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
"""Timeout in seconds for requests methods"""
NEWLINE = "\n"
"""Definition of newline"""
def debug(message: str) -> None:
"""Print a debug message to the GitHub Action log"""
newline = "\n"
print(f"""::debug::{message.replace(newline, " ")}""")
print(f"""::debug::{message.replace(NEWLINE, " ")}""")
def error(message: str) -> None:
"""Print an error message to the GitHub Action log"""
print(f"""::error::{message.replace(NEWLINE, " ")}""")
def group(title: str, message: str) -> None:
"""Print an expandable group message to the GitHub Action log"""
print(f"::group::{title}")
print(message)
print("::endgroup::")
class Issue:
@@ -420,7 +434,18 @@ def run() -> None:
debug(f"Command return code: {completed.returncode}")
debug(f"Command output: {completed.stdout}")
debug(f"Command error: {completed.stderr}")
data = json.loads(completed.stdout)
try:
data = json.loads(completed.stdout)
except json.decoder.JSONDecodeError as _:
error(
f"cargo audit did not produce any JSON output. Exit code: {completed.returncode}"
)
group(
"cargo audit output",
f"""stdout:\n{completed.stdout}\n\n\nstderr:\n{completed.stderr}""",
)
sys.exit(2)
summary = create_summary(data)
entries = create_entries(data)