Add manual-approval field to on section for environment-gated workflows#2959
Merged
Add manual-approval field to on section for environment-gated workflows#2959
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add manual approval field to on section in front matter
Add manual-approval field to on section for environment-gated workflows
Nov 1, 2025
pelikhan
approved these changes
Nov 1, 2025
| @@ -0,0 +1,14 @@ | |||
| --- | |||
Contributor
There was a problem hiding this comment.
@copilot move file to folder other test agentic workflows
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request adds manual approval functionality to GitHub Agentic Workflows, allowing workflows to require approval via GitHub Environments before execution. The key changes include:
- Added
manual-approvalfield to the workflow schema that accepts an environment name - Workflows with manual approval now set the
environmentfield on the activation job, triggering GitHub's built-in environment protection rules - Added comprehensive test coverage with unit tests and integration tests
- Updated documentation to reflect the new feature
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/manual_approval.go | Core logic for extracting and validating manual-approval configuration from frontmatter |
| pkg/workflow/manual_approval_test.go | Unit tests for manual approval extraction and processing |
| pkg/workflow/manual_approval_integration_test.go | Integration tests validating compiled YAML output |
| pkg/workflow/compiler.go | Added ManualApproval field to WorkflowData struct and wired up processing |
| pkg/workflow/compiler_jobs.go | Modified buildActivationJob to set environment field when manual approval is configured |
| pkg/workflow/compiler_yaml.go | Added comment header to lock files indicating manual approval requirement |
| pkg/workflow/frontmatter_extraction.go | Added logic to comment out manual-approval field in compiled YAML |
| pkg/parser/schemas/main_workflow_schema.json | Added manual-approval to JSON schema |
| docs/src/content/docs/reference/frontmatter-full.md | Documentation updates for the new field |
| docs/src/content/docs/status.mdx | Added new test workflow to status page |
| .github/workflows/test-manual-approval.md | Test workflow demonstrating manual approval usage |
| .github/workflows/test-manual-approval.lock.yml | Compiled test workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot stopped work on behalf of
pelikhan due to an error
November 1, 2025 19:31
pelikhan
approved these changes
Nov 1, 2025
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.
Adds
manual-approvalfield to theon:section in workflow frontmatter that sets theenvironment:field on the activation job, enabling manual approval gates via GitHub environment protection rules.Implementation
manual-approvalstring field toon:object inmain_workflow_schema.jsonmanual_approval.gowith extraction logic followingstop-afterpatternEnvironmenton activation job inbuildActivationJob()when field is presentcommentOutProcessedFieldsInOnSection()to stripmanual-approval,stop-after, andreactionfrom compiled YAML (these are processed into job properties, not trigger configs)Usage
Generates activation job with:
And comments in lock file:
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.