Skip to content

fix: avoid shell interpretation of PR body in CI workflows#619

Merged
tangcent merged 1 commit intomasterfrom
fix/ci-workflow-shell-interpretation
Mar 17, 2026
Merged

fix: avoid shell interpretation of PR body in CI workflows#619
tangcent merged 1 commit intomasterfrom
fix/ci-workflow-shell-interpretation

Conversation

@tangcent
Copy link
Copy Markdown
Owner

This PR cherry-picks a fix from easy-yapi to avoid shell interpretation of PR body in CI workflows.

Changes

  • Avoid shell interpretation of PR body in CI workflows

Source

Cherry-picked from easy-yapi commit df083dff

Related

Use environment variables and printf instead of direct template
substitution to prevent backticks and special characters in PR
body from being interpreted as shell commands.
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Prevent shell interpretation of PR body in CI workflows

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Prevent shell interpretation of special characters in PR body
• Replace echo with printf and environment variables
• Apply fix to both CI workflow files consistently
Diagram
flowchart LR
  A["PR Body with Special Chars"] -->|"Previously: echo with direct substitution"| B["Shell Interprets Backticks/Vars"]
  A -->|"Now: env var + printf"| C["Safe File Storage"]
  B --> D["Potential Command Execution"]
  C --> E["Safe Processing"]
Loading

Grey Divider

File Changes

1. .github/workflows/pr-close-issue.yml 🐞 Bug fix +4/-2

Use env var and printf for safe PR body handling

• Added PR_BODY environment variable to capture PR body safely
• Replaced echo with printf '%s' to prevent shell interpretation
• Updated comment to reflect environment variable approach

.github/workflows/pr-close-issue.yml


2. .github/workflows/pr-package.yml 🐞 Bug fix +4/-2

Use env var and printf for safe PR body handling

• Added PR_BODY environment variable to capture PR body safely
• Replaced echo with printf '%s' to prevent shell interpretation
• Updated comment to reflect environment variable approach

.github/workflows/pr-package.yml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Mar 16, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@github-actions
Copy link
Copy Markdown
Contributor

📦 Plugin has been packaged for this PR. You can download easy-api-2.4.3.212.0.zip from the GitHub Actions workflow run by clicking on the "Artifacts" dropdown.

@github-actions github-actions bot added the type: bug Something isn't working label Mar 16, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.006%. Comparing base (29838cf) to head (396f1a9).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##              master      #619       +/-   ##
===============================================
+ Coverage     53.908%   54.006%   +0.098%     
+ Complexity      2366      2350       -16     
===============================================
  Files            259       259               
  Lines          14699     13541     -1158     
  Branches        3248      3252        +4     
===============================================
- Hits            7924      7313      -611     
+ Misses          5331      4787      -544     
+ Partials        1444      1441        -3     
Flag Coverage Δ
unittests 54.006% <ø> (+0.098%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 160 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29838cf...396f1a9. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tangcent tangcent merged commit 5b3cf94 into master Mar 17, 2026
15 checks passed
@tangcent tangcent deleted the fix/ci-workflow-shell-interpretation branch March 17, 2026 00:31
@github-actions github-actions bot mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant