Skip to content

[evoskill] Refine developer skill with cross-trigger nullability guards for generated if: expressions - #49472

Merged
pelikhan merged 2 commits into
mainfrom
copilot/evoskill-refine-developer-skill
Aug 1, 2026
Merged

[evoskill] Refine developer skill with cross-trigger nullability guards for generated if: expressions#49472
pelikhan merged 2 commits into
mainfrom
copilot/evoskill-refine-developer-skill

Conversation

Copilot AI commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

A recent regression class showed that generated GitHub Actions conditions can fail at expression-evaluation time when nested github.event.* fields are referenced on incompatible triggers (for example, PR-only fields on push/schedule). This update strengthens the developer skill so future workflow-generation changes consistently guard cross-trigger nullability.

  • Security Best Practices → new guidance section

    • Added “Cross-Trigger Nullability in Generated Conditional Expressions” to .github/skills/developer/SKILL.md (additive only; existing content unchanged).
    • Scoped guidance to Go code that emits workflow if: expressions (not runtime shell logic).
  • Unsafe vs safe generation pattern

    • Documents the failure mode (startup_failure before jobs run) when parent event objects are absent.
    • Adds a safe composition pattern requiring:
      • github.event_name trigger gating
      • explicit parent-object null checks
      • ordered short-circuit evaluation before nested access
  • Operational checklist for reviewers/authors

    • Adds a verification checklist to confirm generated conditions are valid across all declared triggers and that mixed-trigger workflows short-circuit safely.
// SECURE: trigger + parent nullability guards before nested access
condition := fmt.Sprintf(
  "github.event_name == 'pull_request' && github.event.pull_request != null && github.event.pull_request.stack != null && github.event.pull_request.stack.position >= %d && github.event.pull_request.stack.position <= %d",
  minPos,
  maxPos,
)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refine developer skill with cross-trigger nullability guidance [evoskill] Refine developer skill with cross-trigger nullability guards for generated if: expressions Aug 1, 2026
Copilot AI requested a review from pelikhan August 1, 2026 05:49
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Hey @pelikhan 👋 — thanks for driving this important security refinement through the EvoSkill Evolver! The cross-trigger nullability guidance is well-scoped and precisely addresses the P0 regression from issue #49445/#49446.

Here's what looks great:

  • ✅ Documentation is focused and additive (new subsection in security guidance)
  • ✅ Well-linked to training evidence and validation cases
  • ✅ Includes actionable unsafe/safe code contrast and verification checklist

A couple of things to finalize before merge:

  • Complete the WIP verification step — your checklist shows "Run final verification (including required unit-test/report flow)" is pending. Complete this to confirm the guidance is production-ready.
  • Consider adding test coverage — if tests in pkg/workflow/*filter*.go were updated to validate cross-trigger guards (as the verification checklist mentions), including them in this PR would strengthen the change and provide a concrete safeguard.

Once final verification is done and the checklist is fully green, this should be ready for merge.

Generated by ✅ Contribution Check · auto · 46.2 AIC · ⊞ 8.7K ·

@pelikhan
pelikhan marked this pull request as ready for review August 1, 2026 06:25
Copilot AI review requested due to automatic review settings August 1, 2026 06:25
@pelikhan
pelikhan merged commit cb2a454 into main Aug 1, 2026
@pelikhan
pelikhan deleted the copilot/evoskill-refine-developer-skill branch August 1, 2026 06:25

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 guidance for safely generating cross-trigger GitHub Actions conditions.

Changes:

  • Documents trigger and parent-object null guards.
  • Adds safe/unsafe examples and a verification checklist.
  • Missing guidance against unsupported arithmetic operators.
Show a summary per file
File Description
.github/skills/developer/SKILL.md Adds cross-trigger condition-generation guidance.

Review details

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +887 to +890
- Guard every trigger-specific object chain (`github.event.pull_request.*`, `github.event.issue.*`, etc.) with `github.event_name` checks.
- Add nullability guards for each parent object in the chain before accessing deeper properties.
- For workflows with multiple triggers, ensure every trigger path either short-circuits safely or avoids unsupported fields entirely.
- Prefer conservative composition (`A && B && C`) where early terms validate event type/object existence before nested access.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.2

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.

[evoskill] EvoSkill: refine developer skill with cross-trigger nullability guidance

3 participants