Sync eng/common directory with azure-sdk-tools for PR 14219#37403
Merged
Sync eng/common directory with azure-sdk-tools for PR 14219#37403
Conversation
Contributor
There was a problem hiding this comment.
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.ps1to support exporting/masking tokens in GitHub Actions viaGITHUB_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. |
weshaggard
approved these changes
Mar 2, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#14219 See eng/common workflow