Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Add Full GitHub Actions Step Specification Support to Jobs Field

This PR adds complete GitHub Actions step specification support to the jobs field in workflow frontmatter, allowing users to utilize all standard step properties when defining custom jobs. It also introduces automatic job dependency management for the agent job.

Changes Made

Schema Updates (pkg/parser/schemas/main_workflow_schema.json):

  • Replaced the restrictive step schema with a complete GitHub Actions step specification
  • Added support for all standard step properties: id, if, name, uses, run, with, env, continue-on-error, timeout-minutes, working-directory, shell
  • Implemented proper validation using oneOf constraint to ensure steps have either uses or run (but not both or neither)

Test Coverage (pkg/workflow/jobs_full_spec_test.go):

  • Added comprehensive tests covering all step properties
  • Tests verify properties are correctly preserved during compilation
  • Tests validate schema enforcement of step constraints

Compiler Enhancement (pkg/workflow/compiler_jobs.go):

  • Modified buildMainJob to automatically add custom job names as dependencies
  • Agent job now waits for all custom jobs defined in frontmatter before executing
  • Enables workflows to define prerequisite jobs that run before the AI agent

Super-Linter Workflow Update (.github/workflows/super-linter-report.md):

  • Moved linter steps from frontmatter into a custom super_linter job
  • Agent job automatically depends on super_linter job completion
  • Agent downloads super-linter.log artifact after linter completes
  • Demonstrates custom jobs with artifact upload/download pattern

Main Branch Merge:

  • Successfully merged latest changes from main branch
  • Resolved merge conflicts in super-linter-report.lock.yml
  • All workflows recompiled successfully
  • All tests pass after merge

Problem Solved

Previously, the jobs field defined steps with a restrictive schema:

"steps": {
  "type": "array",
  "items": {
    "type": "object",
    "additionalProperties": false  // Too restrictive!
  }
}

This prevented users from:

  1. Using standard GitHub Actions step properties like id, env, timeout-minutes, etc.
  2. Defining custom jobs that run before the AI agent

Now users can:

  1. Specify complete step configurations matching the full GitHub Actions specification
  2. Define custom jobs that the agent automatically waits for before executing
  3. Share data between custom jobs and the agent via artifacts or outputs

Testing

  • ✅ All unit tests pass (make test-unit)
  • ✅ Code formatting validates (make fmt)
  • ✅ Linting passes (make lint)
  • ✅ Full agent-finish validation passes
  • ✅ All 74 repository workflows compile successfully
  • ✅ Comprehensive new tests validate step property support and schema validation
  • ✅ Super-linter workflow demonstrates custom job dependencies
  • ✅ Successfully merged with main branch
  • ✅ All tests pass after merge

The implementation allows users to use the full GitHub Actions step specification in their custom jobs with proper validation and support for all standard properties, plus automatic job dependency management.

Original prompt

Add support for full GitHub actions specification in front matter "jobs" field. Currently the steps are not full GitHub actions specification steps. Reuse existing types in the JSON schema and ensure the compiler parses the job correctly.


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

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

pelikhan commented Nov 7, 2025

@copilot keep working

…port

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

Copilot AI commented Nov 7, 2025

@copilot keep working

Implementation completed in e8adda7. The jobs field now supports the full GitHub Actions step specification including all standard properties: id, if, name, uses, run, with, env, continue-on-error, timeout-minutes, working-directory, and shell. Schema validation enforces proper step structure (requires either uses or run). All tests pass including comprehensive new tests for step property validation.

Copilot AI changed the title [WIP] Add support for full GitHub actions specification in jobs field Add support for full GitHub actions specification in jobs field Nov 7, 2025
@pelikhan
Copy link
Contributor

pelikhan commented Nov 7, 2025

@copilot update the super-linter agentic workflow: move the steps in the front matter into a job (super_linter) and add a needs dependency to the agent job as 'super_linter'. The super_linter job should upload the super-linter logs as an artifact (super-linter.log) and the agent should download the super-linter.log artifacts.

Copilot finished work on behalf of pelikhan November 7, 2025 17:24
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

pelikhan commented Nov 7, 2025

@copilot keep working

Copilot stopped work on behalf of pelikhan due to an error November 7, 2025 17:49
@pelikhan
Copy link
Contributor

pelikhan commented Nov 7, 2025

@copilot keep working

- Modified buildMainJob to automatically add custom job names to agent job dependencies
- Agent job now waits for all custom jobs defined in frontmatter before executing
- Updated super-linter-report workflow to demonstrate the feature

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

Copilot AI commented Nov 7, 2025

@copilot keep working

Completed in aa73e19. The super-linter workflow has been updated:

  • Moved linter steps into a super_linter custom job
  • Agent job automatically depends on super_linter job (via automatic dependency detection)
  • Agent downloads the super-linter.log artifact uploaded by the linter job
  • All environment variables in the super-linter step have been converted to strings for schema compliance

The implementation adds automatic dependency management: the agent job now automatically waits for all custom jobs defined in the frontmatter before executing.

Copilot AI changed the title Add support for full GitHub actions specification in jobs field Add support for full GitHub actions specification in jobs field and automatic job dependencies Nov 7, 2025
Copilot finished work on behalf of pelikhan November 7, 2025 18:09
@pelikhan pelikhan marked this pull request as ready for review November 7, 2025 19:22
Copilot AI review requested due to automatic review settings November 7, 2025 19:22
@pelikhan
Copy link
Contributor

pelikhan commented Nov 7, 2025

@copilot Merge main

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds complete GitHub Actions step specification support to the jobs field in workflow frontmatter and introduces automatic job dependency management. Users can now define custom jobs using all standard GitHub Actions step properties, and the agent job automatically waits for custom jobs to complete before executing.

Key changes:

  • Enhanced step schema to support all GitHub Actions step properties with proper validation
  • Added automatic dependency injection so custom jobs run before the agent job
  • Refactored super-linter workflow to use a custom job that runs before the agent

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/parser/schemas/main_workflow_schema.json Replaced restrictive step schema with complete GitHub Actions specification including all standard properties
pkg/workflow/compiler_jobs.go Added logic to automatically make agent job depend on custom jobs
pkg/workflow/jobs_full_spec_test.go Added comprehensive tests for full step specification and validation
.github/workflows/super-linter-report.md Refactored to demonstrate custom job pattern with super_linter job
.github/workflows/super-linter-report.lock.yml Generated workflow reflecting custom job dependencies
docs/src/content/docs/status.mdx Added super-linter-report workflow to status page

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

pelikhan and others added 4 commits November 7, 2025 11:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 7, 2025

@copilot Merge main

Main branch merged successfully in c800483. Resolved merge conflicts in super-linter-report.lock.yml and recompiled all workflows. All tests pass after the merge.

Copilot AI requested a review from pelikhan November 7, 2025 19:39
Copilot finished work on behalf of pelikhan November 7, 2025 19:39
@pelikhan pelikhan merged commit 8325037 into main Nov 7, 2025
39 of 43 checks passed
@pelikhan pelikhan deleted the copilot/add-github-actions-support branch November 7, 2025 19:44
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