Skip to content

fix(deps-update): put the audit and outdated reports in the PR body - #75

Merged
tsvikas merged 1 commit into
mainfrom
deps-update-pr-body
Sep 27, 2026
Merged

tsvikas merged 1 commit into
mainfrom
deps-update-pr-body

Conversation

@tsvikas

@tsvikas tsvikas commented Sep 27, 2026

Copy link
Copy Markdown
Owner

The "Security Audit" and "Outdated Packages" blocks in generated projects' dependency-update PRs were always empty, for example tsvikas/git-fetch-all#28. This bug has been there since the workflow was added (48c8908).

Cause

Each step appended its NAME<<EOF / EOF markers to $GITHUB_OUTPUT, but the command between them printed to the job log. In the git-fetch-all run, the log has "Found no known vulnerabilities … in 93 packages" while the PR shows an empty block.

Changes

  • Redirect: each step is wrapped as { echo 'NAME<<EOF'; …; echo 'EOF'; } >> "$GITHUB_OUTPUT", so the output lands between the markers.
  • Color codes: deps-list-outdated runs uv tree --outdated --color always, so the captured output is piped through sed 's/\x1b\[[0-9;]*m//g'. Without it, the PR body would show raw escape codes. The recipe itself is unchanged, so it stays colored in a terminal.
  • Quieter uv run: uv run -q just … keeps uv's own "Downloading … / Installed …" sync messages out. just still echoes the recipe line (uv audit --locked), which shows which command produced the report.
  • Failures still don't stop the PR: || true is gone, because without pipefail the pipeline's exit status is sed's. A comment explains this.

Verification

Ran the steps' shell locally in a generated project:

  • Audit, with pygments pinned to 2.18.0: the captured block contains the full report, including both pygments advisories and "Fixed in: 2.20.0". The step exits 0 even though the audit fails.
  • Outdated, with six pinned to 1.16.0 in a scratch project: └── six v1.16.0 (latest: v1.17.0). The raw output contained ^[[36m^[[1m escapes, and the captured output has none.
  • prek passes (actionlint, zizmor, check-github-workflows, yamllint).

I tried just --quiet first. It silences the recipe commands' output too, so it's not usable here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GyMoD8tx4oz1bpJ1tEL845

Both steps wrote their `<<EOF` markers to $GITHUB_OUTPUT but printed the
command output to the job log, so the PR body always showed empty
blocks (seen on tsvikas/git-fetch-all#28). Redirect the whole group,
use `uv run -q` to keep uv's own sync messages out, and strip the ANSI
colors that `uv tree --color always` emits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GyMoD8tx4oz1bpJ1tEL845

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@tsvikas
tsvikas merged commit 623b711 into main Sep 27, 2026
5 checks passed
@tsvikas
tsvikas deleted the deps-update-pr-body branch September 27, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant