Skip to content

Sync eng/common directory with azure-sdk-tools for PR 14219#37403

Merged
azure-sdk merged 5 commits intomainfrom
sync-eng/common-AddGHAppWorkflowLogin-14219
Mar 2, 2026
Merged

Sync eng/common directory with azure-sdk-tools for PR 14219#37403
azure-sdk merged 5 commits intomainfrom
sync-eng/common-AddGHAppWorkflowLogin-14219

Conversation

@azure-sdk
Copy link
Collaborator

Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#14219 See eng/common workflow

Copilot AI review requested due to automatic review settings February 27, 2026 23:05
@azure-sdk azure-sdk requested a review from a team as a code owner February 27, 2026 23:05
@azure-sdk azure-sdk requested a review from weshaggard February 27, 2026 23:05
@azure-sdk azure-sdk added EngSys This issue is impacting the engineering system. Central-EngSys This issue is owned by the Engineering System team. labels Feb 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR syncs eng/common changes from azure-sdk-tools PR 14219 by extending the existing GitHub App token minting script to work in GitHub Actions and adding a composite action wrapper for it.

Changes:

  • Update eng/common/scripts/login-to-github.ps1 to support exporting/masking tokens in GitHub Actions via GITHUB_ENV.
  • Add a new composite GitHub Action (eng/common/actions/login-to-github/action.yml) that wraps the PowerShell script for GH Actions workflows.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
eng/common/scripts/login-to-github.ps1 Adds GH Actions environment export/masking and tweaks error output for Key Vault signing failures.
eng/common/actions/login-to-github/action.yml New composite action wrapper and usage documentation for the login script in GH Actions.

@azure-sdk azure-sdk merged commit 11033de into main Mar 2, 2026
23 checks passed
@azure-sdk azure-sdk deleted the sync-eng/common-AddGHAppWorkflowLogin-14219 branch March 2, 2026 20:55
deyaaeldeen added a commit that referenced this pull request Mar 5, 2026
Extracts the suspicious-PR detection logic from the workflow's inline
bash into a proper TypeScript module at eng/tools/detect-suspicious-pr/
with full test coverage.

Structure:
  src/detect.ts  – pure detection functions (checkInjection, checkCiFiles,
                   checkLifecyclePatch, detectSuspiciousPR)
  src/run.ts     – CLI entry point: reads JSON from stdin, exits 1 if
                   suspicious
  src/index.ts   – public re-exports
  test/detect.test.ts – 124 vitest tests across 6 suites

The workflow now:
  1. Sparse-checks out the detection tool from the base branch
  2. Installs its deps with npm
  3. Gathers PR metadata via gh CLI and builds a JSON payload
  4. Pipes it to the TypeScript detector via tsx
  5. Closes the PR if the detector exits non-zero

Tests cover:
  - 35 malicious branch name patterns (injection, PS, shell, URLs, etc.)
  - 15 benign branch names (including real merged community PRs)
  - 12 malicious + 10 benign PR titles
  - 4 commit message cases
  - 9 protected CI/CD paths + 4 registry/build configs + 10 safe paths
  - 10 malicious + 6 benign npm lifecycle patches
  - 8 end-to-end integration scenarios (real PR #37419, #37403, #35428)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Central-EngSys This issue is owned by the Engineering System team. EngSys This issue is impacting the engineering system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants