Skip to content

Flag pull_request → pull_request_target trigger escalation in compiler safe-update analysis#44925

Merged
pelikhan merged 3 commits into
mainfrom
copilot/extend-compiler-security-analysis
Jul 11, 2026
Merged

Flag pull_request → pull_request_target trigger escalation in compiler safe-update analysis#44925
pelikhan merged 3 commits into
mainfrom
copilot/extend-compiler-security-analysis

Conversation

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

This change extends compiler security analysis to detect event-trigger privilege escalation during workflow updates. Specifically, it flags when a workflow removes pull_request and replaces it with pull_request_target, which requires explicit security review.

  • Safe-update enforcement: detect trigger escalation

    • Extended EnforceSafeUpdate(...) to compare previous vs current trigger posture for PR events.
    • Added escalation detection when baseline is pull_request (without pull_request_target) and the updated workflow shifts to pull_request_target only.
    • Surfaced escalation as a structured safe-update violation alongside existing secret/action/redirect checks.
  • Compiler wiring: baseline/current trigger extraction

    • Added extraction of prior trigger state from the previously compiled lock workflow content.
    • Added extraction of current trigger state from frontmatter on: data.
    • Passed both states into safe-update enforcement for drift-aware security checks.
  • Diagnostics and test coverage

    • Updated safe-update error construction to include an explicit “Event trigger security escalation” section.
    • Added focused tests for:
      • pull_requestpull_request_target escalation detection
      • non-escalation scenarios (e.g., both triggers present)
      • trigger extraction helpers from frontmatter and compiled YAML
// Escalation condition enforced by safe-update:
oldHasPR && !oldHasPRTarget && !currentHasPR && currentHasPRTarget

Copilot AI and others added 2 commits July 11, 2026 09:20
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review July 11, 2026 09:30
Copilot AI review requested due to automatic review settings July 11, 2026 09:30
@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ failed to deliver outputs during design decision gate check.

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Copilot AI left a comment

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.

Pull request overview

Adds safe-update detection for escalation from pull_request to pull_request_target.

Changes:

  • Records pull-request trigger metadata in lock-file manifests.
  • Enforces escalation checks and adds tests.
  • Changes the generated auto-upgrade schedule.
Show a summary per file
File Description
pkg/workflow/safe_update_manifest.go Adds trigger metadata and detection.
pkg/workflow/safe_update_manifest_test.go Tests trigger capture.
pkg/workflow/safe_update_enforcement.go Adds escalation enforcement.
pkg/workflow/safe_update_enforcement_test.go Tests escalation behavior and messages.
pkg/workflow/compiler.go Passes current triggers into enforcement.
pkg/workflow/compiler_yaml.go Records triggers in generated manifests.
pkg/workflow/compiler_threat_detection_formal_test.go Updates enforcement call sites.
.github/workflows/agentic-auto-upgrade.yml Changes the weekly schedule.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 8/8 changed files
  • Comments generated: 3
  • Review effort level: Medium

Comment on lines +60 to +61
HasPullRequest bool `json:"has_pull_request,omitempty"` // whether on: includes pull_request
HasPullRequestTarget bool `json:"has_pull_request_target,omitempty"` // whether on: includes pull_request_target
Comment thread pkg/workflow/safe_update_enforcement.go Outdated

return buildSafeUpdateError(secretViolations, addedActions, removedActions, addedRedirect, removedRedirect)
func hasPullRequestTargetEscalation(manifest *GHAWManifest, currentHasPullRequest bool, currentHasPullRequestTarget bool) bool {
return manifest.HasPullRequest && !manifest.HasPullRequestTarget && !currentHasPullRequest && currentHasPullRequestTarget
on:
schedule:
- cron: "21 3 * * 5" # Weekly (auto-upgrade)
- cron: "11 4 * * 6" # Weekly (auto-upgrade)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add safe-update detection for pull_request_target trigger escalation Flag pull_request → pull_request_target trigger escalation in compiler safe-update analysis Jul 11, 2026
Copilot AI requested a review from pelikhan July 11, 2026 09:37
@github-actions

Copy link
Copy Markdown
Contributor

Warning

The push_to_pull_request_branch operation failed: Cannot push to pull request branch: bundle modifies files outside the allowed-files list (pkg/workflow/compiler.go, pkg/workflow/compiler_threat_detection_formal_test.go, pkg/workflow/safe_update_enforcement.go, pkg/workflow/safe_update_enforcement_test.go). Add the files to the allowed-files configuration field or remove them from the bundle.. The code changes were not applied.

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (137 new lines in pkg/workflow/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/44925-detect-pull-request-target-trigger-escalation.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch (docs/adr/44925-detect-pull-request-target-trigger-escalation.md)
  2. Complete any missing sections — add context the AI could not infer, refine the decision rationale, and confirm the alternatives you actually considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-44925: Detect pull_request_target Trigger Escalation

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number (e.g., 44925-detect-pull-request-target-trigger-escalation.md for PR #44925).

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · 50.1 AIC · ⌖ 10.1 AIC · ⊞ 8.5K ·
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 87/100 — Excellent

Analyzed 33 test(s): 26 design, 7 implementation, 0 violation(s).

📊 Metrics (33 tests)
Metric Value
Analyzed 33 (Go: 33, JS: 0)
✅ Design 26 (79%)
⚠️ Implementation 7 (21%)
Edge/error coverage 28 (85%)
Duplicate clusters 0
Inflation NO
🚨 Violations 0
Test File Classification Issues
TestFormal_CTR016_NilManifestSkipsEnforcement compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_EmptyManifestRejectsNewSecret compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_GitHubTokenExempt_BareForm compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_GitHubTokenExempt_PrefixedForm compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_GhAwInternalSecretExempt compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_SecretPrefixNormalization compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_NewActionDriftRejected compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_RemovedActionDriftRejected compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_KnownActionPinUpdateAllowed compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_RedirectWhitespaceNormalization compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR016_RedirectChangeRejected compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR001_WritePermissionsRejected compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR001_ReadOnlyPermissionsAllowed compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR001_EmptyPermissionsAllowed compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR011_AllowURLsRequiresSSLBump compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR011_AllowURLsWithSSLBumpAllowed compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR011_WildcardOnlyDomainRejected compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR015_WildcardLabelRejected compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR015_WildcardLabelRejected_CreateDiscussion compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR015_SpecificLabelsAllowed compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR015_NilConfigAllowed compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR014_StrictModeEnabledRejected compiler_threat_detection_formal_test.go design_test none
TestFormal_CTR014_DisabledAlwaysAllowed compiler_threat_detection_formal_test.go design_test none
TestEnforceSafeUpdate safe_update_enforcement_test.go design_test none
TestBuildSafeUpdateError safe_update_enforcement_test.go design_test none
TestCollectActionViolations safe_update_enforcement_test.go implementation_test none
TestEffectiveSafeUpdate safe_update_enforcement_test.go implementation_test none
TestNewGHAWManifest safe_update_manifest_test.go design_test none
TestNewGHAWManifestContainerDigest safe_update_manifest_test.go design_test none
TestGHAWManifestToJSON safe_update_manifest_test.go design_test none
TestExtractGHAWManifestFromLockFile safe_update_manifest_test.go design_test none
TestNormalizeSecretName safe_update_manifest_test.go implementation_test none
TestParseActionRefs safe_update_manifest_test.go implementation_test none

Verdict

Passed. 21% implementation tests (threshold: 30%). No guideline violations. All three files carry the required //go:build !integration build tag. The new pull_request_target escalation detection is well-exercised with both the conversion case and the coexistence (non-conversion) case.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel · 52.7 AIC · ⌖ 8.44 AIC · ⊞ 6.8K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

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.

✅ Test Quality Sentinel: 87/100. 21% implementation tests (threshold: 30%). No violations.

@github-actions github-actions Bot left a comment

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.

Security Review: hasPullRequestTargetEscalation has incomplete coverage

The PR correctly adds detection for pull_request → pull_request_target replacement, but the guard condition on line 97 is narrower than the actual security boundary.

Current condition fires only when the old workflow had pull_request (not pull_request_target) AND the new workflow has pull_request_target but no longer has pull_request. Two scenarios bypass it:

  1. Fresh PRT addition — old workflow had no PR triggers; new adds pull_request_target. Guard never fires because manifest.HasPullRequest == false.
  2. Additive PRT — old kept pull_request; new keeps it and also adds pull_request_target. Guard never fires because currentHasPullRequest == true. The existing test marks this wantErr: false, but any new introduction of pull_request_target is a privilege escalation (base-branch context, full secrets for fork PRs).

Broadened fix: return !manifest.HasPullRequestTarget && currentHasPullRequestTarget

Everything else — detectPullRequestEvents, manifest fields, error message wording, and test structure — is well done.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 36.4 AIC · ⌖ 4.52 AIC · ⊞ 4.8K

Comment thread pkg/workflow/safe_update_enforcement.go Outdated

return buildSafeUpdateError(secretViolations, addedActions, removedActions, addedRedirect, removedRedirect)
func hasPullRequestTargetEscalation(manifest *GHAWManifest, currentHasPullRequest bool, currentHasPullRequestTarget bool) bool {
return manifest.HasPullRequest && !manifest.HasPullRequestTarget && !currentHasPullRequest && currentHasPullRequestTarget

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.

The escalation condition checks only the pull_request → pull_request_target replacement pattern (old had PR, old lacked PRT, new lacks PR, new has PRT). This leaves two privilege-escalation scenarios undetected:

  1. Fresh addition: old workflow had no PR triggers at all (HasPullRequest == false), new workflow adds pull_request_target. Because manifest.HasPullRequest is false, the guard never fires.
  2. Additive escalation: old workflow had pull_request, new keeps it and adds pull_request_target. The existing test explicitly marks this wantErr: false, but pull_request_target runs with base-branch context and full secret access for fork PRs — adding it is a privilege upgrade regardless of whether pull_request is retained.

Suggested broadened check:

// Flag if PRT is newly introduced (regardless of whether PR was kept or dropped)
func hasPullRequestTargetEscalation(manifest *GHAWManifest, currentHasPullRequest bool, currentHasPullRequestTarget bool) bool {
    return !manifest.HasPullRequestTarget && currentHasPullRequestTarget
}

This fires whenever pull_request_target goes from absent → present, which is the actual security boundary. The PR author should evaluate whether cases 1 & 2 are intentionally out of scope (and document that decision) or are gaps.

@copilot please address this.

@github-actions github-actions Bot left a comment

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.

REQUEST_CHANGES — one blocking security gap

The PR correctly detects pull_request to pull_request_target conversions, but the escalation predicate is too narrow and will miss the equally dangerous case where a workflow adds pull_request_target fresh (with no prior pull_request trigger).

Blocking issues:

  1. hasPullRequestTargetEscalation only fires when manifest.HasPullRequest == true (safe_update_enforcement.go:97). A push/schedule-only workflow silently passes enforcement even when pull_request_target is newly introduced. Fix: drop the manifest.HasPullRequest guard and key only on !manifest.HasPullRequestTarget && currentHasPullRequestTarget.
  2. No test covers the fresh-PRT addition case (safe_update_enforcement_test.go). Without a test for HasPullRequest=false, currentHasPRTarget=true, the gap above will never be caught by CI.

Non-blocking: omitempty on the two new bool fields (safe_update_manifest.go:60-61) makes JSON ambiguous; removing it so false is always explicit would be more robust.

🔎 Code quality review by PR Code Quality Reviewer · 54.1 AIC · ⌖ 4.85 AIC · ⊞ 5.4K
Comment /review to run again

Comment thread pkg/workflow/safe_update_enforcement.go Outdated

return buildSafeUpdateError(secretViolations, addedActions, removedActions, addedRedirect, removedRedirect)
func hasPullRequestTargetEscalation(manifest *GHAWManifest, currentHasPullRequest bool, currentHasPullRequestTarget bool) bool {
return manifest.HasPullRequest && !manifest.HasPullRequestTarget && !currentHasPullRequest && currentHasPullRequestTarget

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.

Security gap: escalation detection is blind to fresh pull_request_target additions — a workflow that was previously push/schedule-only can silently add pull_request_target without triggering enforcement.

💡 Analysis and suggested fix

The current condition is:

return manifest.HasPullRequest && !manifest.HasPullRequestTarget && !currentHasPullRequest && currentHasPullRequestTarget

This only fires when the old manifest explicitly recorded has_pull_request: true. A workflow with only push or schedule in the old manifest will have manifest.HasPullRequest == false, so the entire expression short-circuits to false. An attacker-authored PR can therefore introduce pull_request_target (which grants write access to repo secrets/code in a fork-triggered context) without any enforcement warning.

Suggested fix — widen the detection to any new appearance of pull_request_target:

func hasPullRequestTargetEscalation(manifest *GHAWManifest, currentHasPullRequestTarget bool) bool {
    // Flag any new introduction of pull_request_target, not just PR→PRT conversion.
    return !manifest.HasPullRequestTarget && currentHasPullRequestTarget
}

The existing test case "pull_request converted to pull_request_target is flagged" would still pass; the additional case "push-only workflow adds pull_request_target" would now also be caught.

ResolutionFailures []GHAWManifestResolutionFailure `json:"resolution_failures,omitempty"` // unresolved action-ref pinning failures
Containers []GHAWManifestContainer `json:"containers,omitempty"` // container images used, with digest when available
Redirect string `json:"redirect,omitempty"` // frontmatter redirect target for moved workflows
HasPullRequest bool `json:"has_pull_request,omitempty"` // whether on: includes pull_request

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.

omitempty on bool fields makes the manifest JSON ambiguous between false and absent — deserialized old manifests are indistinguishable from manifests that explicitly recorded false.

💡 Details
HasPullRequest       bool `json:"has_pull_request,omitempty"`
HasPullRequestTarget bool `json:"has_pull_request_target,omitempty"`

With omitempty, a false value is silently dropped from the JSON. When the lock file is read back by ExtractGHAWManifestFromLockFile, the missing fields unmarshal to false — identical to an explicitly-set false. This matters for the escalation check: if HasPullRequest is absent (old manifest, pre-feature), it reads as false, and that is already handled by the nil-manifest guard. However, if a manifest was written between the introduction of HasPullRequestTarget and HasPullRequest (or vice versa), the absent field silently reads as false rather than "unknown", potentially suppressing a legitimate escalation warning.

Remove omitempty from both fields so their values are always serialized and the absence/presence distinction is unambiguous:

HasPullRequest       bool `json:"has_pull_request"`
HasPullRequestTarget bool `json:"has_pull_request_target"`

@@ -335,11 +337,35 @@ func TestEnforceSafeUpdate(t *testing.T) {
redirect: " owner/repo/workflows/new.md@main ",

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.

Missing test for the security gap: no test covers adding pull_request_target to a workflow that never had pull_request (e.g., push/schedule-only manifest).

💡 Suggested test case
{
    name: "push-only workflow adds pull_request_target is flagged",
    manifest: &GHAWManifest{
        Version:        1,
        HasPullRequest: false, // was push/schedule only
    },
    secretNames: []string{},
    actionRefs:  []string{},
    hasPR:       false,
    hasPRTarget: true,
    wantErr:     true,
    wantErrMsgs: []string{"Event trigger security escalation"},
},

Without this test (and the corresponding fix in hasPullRequestTargetEscalation), the security gap documented in the companion comment goes undetected in CI.

@github-actions github-actions Bot left a comment

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.

Skills-Based Review 🧠

Applied /tdd, /grill-with-docs, and /codebase-design — requesting changes on two actionable issues.

📋 Key Themes & Highlights

Key Issues

  1. []any list branch untested (safe_update_manifest_test.go) — The most common real-world on: format has no coverage; see inline comment.
  2. Escalation predicate scope (safe_update_enforcement.go:97) — Adding pull_request_target to a non-PR workflow bypasses the check; design intent should be stated and tested.
  3. Missing doc comment on security predicate (safe_update_enforcement.go:96) — The six-field boolean needs an explaining comment.

Positive Highlights

  • detectPullRequestEvents cleanly handles all three YAML on: shapes (string / list / map)
  • ✅ Warning-not-error approach is consistent with existing safe-update philosophy
  • ✅ Good extension of existing EnforceSafeUpdate signature pattern
  • ✅ Existing formal tests updated cleanly with the new parameters

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 65.8 AIC · ⌖ 4.75 AIC · ⊞ 6.6K
Comment /matt to run again

wantVersion: 1,
wantSecrets: []string{},
wantHasPRTarget: true,
},

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.

[/tdd] The []any (YAML list) branch of detectPullRequestEvents has no test coverage — the only two new test cases use string and map[string]any formats.

💡 Suggested test cases

Add to the TestNewGHAWManifest table:

{
    name:            "detect pull_request_target from on list",
    onField:         []any{"push", "pull_request_target"},
    wantVersion:     1,
    wantSecrets:     []string{},
    wantHasPR:       false,
    wantHasPRTarget: true,
},
{
    name:            "detect both from on list",
    onField:         []any{"pull_request", "pull_request_target"},
    wantVersion:     1,
    wantSecrets:     []string{},
    wantHasPR:       true,
    wantHasPRTarget: true,
},

The list format is the most common real-world on: shape (e.g. on: [push, pull_request_target]), so an uncovered branch is a high-probability regression risk.

@copilot please address this.

Comment thread pkg/workflow/safe_update_enforcement.go Outdated

return buildSafeUpdateError(secretViolations, addedActions, removedActions, addedRedirect, removedRedirect)
func hasPullRequestTargetEscalation(manifest *GHAWManifest, currentHasPullRequest bool, currentHasPullRequestTarget bool) bool {
return manifest.HasPullRequest && !manifest.HasPullRequestTarget && !currentHasPullRequest && currentHasPullRequestTarget

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.

[/grill-with-docs] The escalation predicate silently allows adding pull_request_target to a workflow that previously had neither PR trigger — only conversions from pull_request-only are blocked. Adding pull_request_target to a push-only workflow is equally dangerous but falls through.

💡 What the logic currently accepts
// This returns false (no violation) when:
//   manifest.HasPullRequest = false  (was a push-only workflow)
//   manifest.HasPullRequestTarget = false
//   currentHasPullRequest = false
//   currentHasPullRequestTarget = true   ← NEW pull_request_target added
return manifest.HasPullRequest && !manifest.HasPullRequestTarget && !currentHasPullRequest && currentHasPullRequestTarget

Consider whether the intent is "block any fresh introduction of pull_request_target" or strictly "detect a swap". If the former, the condition should be:

return !manifest.HasPullRequestTarget && currentHasPullRequestTarget

Document the design decision (e.g. in a comment) so future editors know the intended scope.

@copilot please address this.

Comment thread pkg/workflow/safe_update_enforcement.go Outdated
}

return buildSafeUpdateError(secretViolations, addedActions, removedActions, addedRedirect, removedRedirect)
func hasPullRequestTargetEscalation(manifest *GHAWManifest, currentHasPullRequest bool, currentHasPullRequestTarget bool) bool {

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.

[/codebase-design] hasPullRequestTargetEscalation lacks a doc comment. It's a security-critical predicate with subtle semantics — the parameter order and boolean logic aren't self-evident, and the lack of comment will slow down future reviewers.

💡 Suggested comment
// hasPullRequestTargetEscalation reports whether the workflow has converted from a
// pull_request-only trigger to pull_request_target without the old manifest
// recording a pull_request_target.  This pattern grants the workflow write
// permissions from untrusted fork code and requires explicit approval.
func hasPullRequestTargetEscalation(...) bool {

@copilot please address this.

@pelikhan pelikhan merged commit 759a5a6 into main Jul 11, 2026
36 checks passed
@pelikhan pelikhan deleted the copilot/extend-compiler-security-analysis branch July 11, 2026 10:34
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.

3 participants