Add refiner workflow for automated code style and security analysis#15307
Merged
Add refiner workflow for automated code style and security analysis#15307
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refine code style and add tests for pull request
Add refiner workflow for automated code style and security analysis
Feb 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements an automated "refiner" workflow that analyzes pull requests labeled with "refine" to align code style with repository conventions, detect security issues, and improve test coverage. The workflow creates a refinement PR with fixes when issues are found.
Changes:
- Adds
.github/workflows/refiner.mddefining the agentic workflow mission, phases, and detailed instructions for code analysis and refinement - Adds
.github/workflows/refiner.lock.ymlcompiled workflow file with job orchestration, safe outputs configuration, and threat detection
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/refiner.md | Workflow definition with comprehensive prompt covering style alignment (Go/JS/test conventions), security scanning (malicious patterns, injection vulnerabilities), test improvement guidance, and edge case handling |
| .github/workflows/refiner.lock.yml | Compiled GitHub Actions workflow with label trigger, Copilot engine, lockdown mode, safe outputs (create-pull-request, add-comment), and threat detection job |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pelikhan
pushed a commit
that referenced
this pull request
Feb 13, 2026
…15319) * Add refiner workflow for automated code style and security analysis (#15307) * test: avoid flaky readonly dir assertion in extractZipFile (#15312) * docs: add unassign-from-user safe output documentation (#15310) * Fix TypeScript type errors in error handling for unknown types (#15308) * Initial plan --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mark L <73659136+liuxiaopai-ai@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pelikhan
pushed a commit
that referenced
this pull request
Feb 13, 2026
* Clean validate_memory_files.cjs - modernize code with arrow functions and optional chaining * Fix JavaScript formatting in merge_remote_agent_github_folder.cjs (#15316) * Merge main branch and resolve conflicts in validate_memory_files.cjs (#15319) * Add refiner workflow for automated code style and security analysis (#15307) * test: avoid flaky readonly dir assertion in extractZipFile (#15312) * docs: add unassign-from-user safe output documentation (#15310) * Fix TypeScript type errors in error handling for unknown types (#15308) * Initial plan --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mark L <73659136+liuxiaopai-ai@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: JSweep Bot <jsweep-bot@github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mark L <73659136+liuxiaopai-ai@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@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.
Implements an agentic workflow that analyzes pull requests for style violations, security issues, and test coverage gaps when labeled with "refine". Creates a refinement PR with fixes.
Workflow Configuration
Trigger:
pull_request labeled refineEngine: Copilot with lockdown mode
Safe outputs:
create-pull-request,add-commentTimeout: 30 minutes with per-PR concurrency control
Analysis Phases
Style alignment: Validates Go/JS/test files against AGENTS.md and scratchpad/dev.md conventions
console.Format*Message())logger.New("pkg:filename"))Security scanning: Detects malicious patterns
::command::patterns)Test improvements: Identifies coverage gaps
require.*vsassert.*Output
Creates PR with
[refiner]prefix containing style fixes, security patches, and test additions. Adds comment to original PR linking to refinement.Exits without creating PR if code already follows conventions or if malicious code detected (reports instead).
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.