Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Top-level safe-jobs is no longer supported. Only safe-outputs.jobs is valid.

Changes

  • Refactoring: Simplified parseSafeJobsConfig() to operate directly on jobs map, removing internal wrapper pattern
  • Schema validation: Top-level safe-jobs is rejected by JSON schema as an unknown property

Example

Previously tolerated (now rejected):

---
safe-jobs:
  deploy:
    runs-on: ubuntu-latest
---

Required syntax:

---
safe-outputs:
  jobs:
    deploy:
      runs-on: ubuntu-latest
---

Error when using deprecated syntax:

error: Unknown property: safe-jobs. Valid fields are: bots, cache, command, concurrency, container, description, engine, env, environment, features, ...

The JSON schema validation is sufficient to catch and reject the unsupported top-level safe-jobs field.

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing

Original prompt

Remove support for top-level "safe-jobs" in the front matter. Only support safe-outputs.jobs

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


💡 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.

Copilot AI and others added 3 commits January 29, 2026 04:24
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…e-jobs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

@copilot remove all support for top level safe-jobs and backward compatibility.

Copilot AI changed the title [WIP] Remove support for top-level "safe-jobs" in front matter Remove top-level safe-jobs support, enforce safe-outputs.jobs Jan 29, 2026
Copilot AI requested a review from pelikhan January 29, 2026 04:39
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot remove all support for top level safe-jobs and backward compatibility.

Done in commit 985ff29.

Changes made:

  1. Removed backward compatibility: Refactored parseSafeJobsConfig() to work directly with jobs map, eliminating the internal "safe-jobs" key wrapper pattern
  2. Added explicit rejection: Top-level safe-jobs field is now explicitly rejected in both main and shared workflows with a clear migration error message
  3. Tests updated: All tests now use the direct jobs map approach

Top-level safe-jobs is completely unsupported - only safe-outputs.jobs is valid.

@pelikhan pelikhan marked this pull request as ready for review January 29, 2026 04:50
detectionLog.Printf("No 'on' field detected - treating as shared agentic workflow")

// Reject top-level "safe-jobs" field (only safe-outputs.jobs is supported)
if err := c.validateNoTopLevelSafeJobs(frontmatterForValidation, cleanPath); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove check and remove function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in commit feacfe2. The check and function have been deleted - schema validation already catches "safe-jobs" as an unknown property.

}

// Reject top-level "safe-jobs" field before schema validation (provides better error message)
if err := c.validateNoTopLevelSafeJobs(frontmatterForValidation, cleanPath); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in commit feacfe2.


// validateNoTopLevelSafeJobs validates that the frontmatter does not contain a top-level "safe-jobs" field.
// Only safe-outputs.jobs is supported.
func (c *Compiler) validateNoTopLevelSafeJobs(frontmatter map[string]any, filePath string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copiliot remove function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in commit feacfe2. The validateNoTopLevelSafeJobs function has been deleted along with its test file.

…ches it

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan January 29, 2026 04:59
@pelikhan pelikhan merged commit 10f1341 into main Jan 29, 2026
50 checks passed
@pelikhan pelikhan deleted the copilot/remove-safe-jobs-support branch January 29, 2026 05:20
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.

2 participants