Skip to content

Update auto-docs workflow for PR handling#10078

Open
LigiaZ wants to merge 1 commit intomainfrom
LigiaZ-patch-1
Open

Update auto-docs workflow for PR handling#10078
LigiaZ wants to merge 1 commit intomainfrom
LigiaZ-patch-1

Conversation

@LigiaZ
Copy link
Copy Markdown
Contributor

@LigiaZ LigiaZ commented May 8, 2026

Context

Implementation

Screenshots

before after

How to Test

Get in Touch

@LigiaZ LigiaZ requested a review from evanjacobson May 8, 2026 16:02
gh api "repos/$REPO/pulls/$PR_NUMBER" > pr.json
{
echo "TITLE=$(jq -r .title pr.json)"
echo "BODY<<__EOF__"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: PR bodies can break out of the fixed GITHUB_ENV heredoc

The PR body is untrusted input, and a body containing a line equal to __EOF__ terminates this heredoc early and lets following lines be interpreted as additional GITHUB_ENV commands for later steps. Avoid writing arbitrary PR text to GITHUB_ENV with a static delimiter; build payload.json directly from pr.json, or use a generated delimiter that cannot appear in the value.

# For workflow_dispatch it evaluates to empty, so we fall back to the
# values written to GITHUB_ENV by the "Fetch PR metadata" step above.
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
TITLE: ${{ github.event.pull_request.title || env.TITLE }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Manual-dispatch metadata can be overwritten with empty values

Values written via $GITHUB_ENV are available to the next step's shell environment, but this step immediately redefines TITLE, BODY, AUTHOR, MERGED_AT, and PR_URL through its own env: block. On workflow_dispatch, ${{ env.TITLE }} is not the runtime value appended in the previous step, so the manual test path can send empty metadata instead of the fetched PR fields.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 8, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
.github/workflows/auto-docs.yml 57 PR bodies can break out of the fixed GITHUB_ENV heredoc
.github/workflows/auto-docs.yml 73 Manual-dispatch metadata can be overwritten with empty values
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
- - None
Files Reviewed (1 files)
  • .github/workflows/auto-docs.yml - 2 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.5-2026-04-23 · 121,375 tokens

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