Skip to content

Harden perf-comment workflow inputs#16174

Open
vineethkuttan wants to merge 1 commit into
mainfrom
perfcomm
Open

Harden perf-comment workflow inputs#16174
vineethkuttan wants to merge 1 commit into
mainfrom
perfcomm

Conversation

@vineethkuttan
Copy link
Copy Markdown
Contributor

@vineethkuttan vineethkuttan commented May 22, 2026

Description

Follow GitHub's recommended best practices for workflow_run triggered workflows that consume artifacts from untrusted runs.

Type of Change

  • Validate PR number: Add a strict numeric check (^[1-9][0-9]*$) in the shell step before setting the output, so malformed artifact data is rejected early.
  • Use environment variables instead of expression interpolation: Pass `PR_NUMBER and REPORT_PATH via env: block instead of inlining ${{ }} expressions in the actions/github-script body. This aligns with the GitHub security hardening guide for github-script.
  • Add defense-in-depth integer check in JS: Validate prNumber is a positive integer before using it in API calls.

Changelog

Should this change be included in the release notes: no

Microsoft Reviewers: Open in CodeFlow

@vineethkuttan vineethkuttan requested review from a team as code owners May 22, 2026 10:05
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