Skip to content

Comments

Support for Contributions of Agentic Workflows#786

Open
brunoborges wants to merge 6 commits intogithub:stagedfrom
brunoborges:agentic-workflows-staged
Open

Support for Contributions of Agentic Workflows#786
brunoborges wants to merge 6 commits intogithub:stagedfrom
brunoborges:agentic-workflows-staged

Conversation

@brunoborges
Copy link
Contributor

Summary

Makes this project welcoming to users who want to contribute their own Agentic Workflows — AI-powered repository automations that run coding agents in GitHub Actions, defined in markdown with natural language instructions.

Changes

  • New workflows/ directory for community-contributed agentic workflows (flat .md files)
  • Build pipeline integration — metadata parsing, README generation, and website data generation for workflows
  • CI validation workflow (validate-agentic-workflows-pr.yml) with two jobs:
    • Block forbidden files — rejects .yml, .yaml, .lock.yml, and .github/ modifications
    • Compile and validate — runs gh aw compile --validate on each workflow .md file
  • Documentation updates — README.md, CONTRIBUTING.md, and AGENTS.md with workflow docs, contributing guidelines, examples, and code review checklists
  • PR template updated with Agentic Workflow as a contribution type
  • validate-readme.yml updated to trigger on workflows/** changes

Type of Contribution

  • New agentic workflow.
  • Other: Infrastructure to support agentic workflow contributions

brunoborges and others added 6 commits February 20, 2026 17:09
Add support for contributing Agentic Workflows — AI-powered repository
automations that run coding agents in GitHub Actions, defined in markdown
with natural language instructions (https://github.github.com/gh-aw).

Changes:
- Create workflows/ directory for community-contributed workflows
- Add workflow metadata parsing (yaml-parser.mjs)
- Add workflow README generation (update-readme.mjs, constants.mjs)
- Add workflow data to website generation (generate-website-data.mjs)
- Update README.md, CONTRIBUTING.md, and AGENTS.md with workflow docs,
  contributing guidelines, and code review checklists

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds validate-agentic-workflows.yml that runs on PRs touching workflows/.
Uses gh-aw CLI setup action to install the compiler, then runs
'gh aw compile --validate' on each workflow .md file. Posts a sticky
PR comment with fix instructions on failure.

Also adds workflows/** to validate-readme.yml path triggers so README
tables are regenerated when workflows change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prevents contributors from pushing compiled YAML (.yml, .yaml, .lock.yml)
or .github/ directories into the workflows/ directory. Only .md markdown
source files are accepted — compilation happens downstream via gh aw compile.

This is a security measure to prevent malicious GitHub Actions code
from being introduced through contributed agentic workflows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Workflows are now standalone .md files in workflows/ — no subfolders
or README.md needed. Each file contains both the metadata frontmatter
(name, description, triggers, tags) and the agentic workflow definition
(on, permissions, safe-outputs) in a single file.

Updated all build scripts, CI workflows, docs, and review checklists.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merges the two separate action workflows (block-workflow-yaml.yml and
validate-agentic-workflows.yml) into a single validate-agentic-workflows-pr.yml
with two jobs: check-forbidden-files runs first, then compile-workflows
runs only if the file check passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 21, 2026 01:16
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

Adds first-class repository support for community-contributed Agentic Workflows (markdown-defined automations for gh-aw), integrating them into the build/readme generation, website data generation, CI validation, and contribution docs.

Changes:

  • Introduces a new workflows/ resource type (flat .md files) with metadata parsing and README generation.
  • Extends website data/search index generation to include workflows and emits workflows.json.
  • Adds PR-time CI validation for workflow contributions and updates docs/templates to include workflows.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
workflows/.gitkeep Ensures the new workflows/ directory exists in git.
eng/yaml-parser.mjs Adds parseWorkflowMetadata() for workflow frontmatter parsing.
eng/update-readme.mjs Generates docs/README.workflows.md via a new workflows section builder.
eng/generate-website-data.mjs Generates workflows metadata, adds workflows to search index, and writes workflows.json.
eng/constants.mjs Adds WORKFLOWS_DIR and new README template snippets for workflows.
docs/README.workflows.md New generated documentation page for workflows (currently empty state).
README.md Adds workflows to the main README navigation and repo structure/docs.
CONTRIBUTING.md Adds contribution guidance and an example workflow file format.
AGENTS.md Documents workflow file expectations and adds a review checklist for workflows.
.github/workflows/validate-readme.yml Triggers README validation when workflows/** changes.
.github/workflows/validate-agentic-workflows-pr.yml New CI workflow to block forbidden files and validate workflows with gh aw compile --validate.
.github/pull_request_template.md Adds “agentic workflow” as a contribution type and checklist item.
Comments suppressed due to low confidence (1)

.github/workflows/validate-agentic-workflows-pr.yml:112

  • Same as earlier: commenting on PRs from forks will usually fail under pull_request due to missing write permissions. Please guard this step with a permission check (like validate-readme.yml does) so validation failures still surface without the workflow erroring while trying to comment.
      - name: Comment on PR if compilation failed
        if: failure()
        uses: marocchino/sticky-pull-request-comment@v2
        with:
          header: workflow-validation

Comment on lines +278 to +286
// Extract triggers from frontmatter if present
const triggers = frontmatter.triggers || [];

return {
name: frontmatter.name,
description: frontmatter.description,
triggers,
tags: frontmatter.tags || [],
path: filePath,
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

frontmatter.triggers is treated as an array downstream (e.g., .length/.join() in README generation and .forEach() in website data). If a contributor provides a scalar (e.g., triggers: schedule) this will throw at build time. Normalize/validate here (e.g., Array.isArray(frontmatter.triggers) ? frontmatter.triggers : []) and consider warning when the type is invalid.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +27 to +33
# Check for YAML/lock files in workflows/ and any .github/ modifications
forbidden=$(git diff --name-only --diff-filter=ACM origin/${{ github.base_ref }}...HEAD -- \
'workflows/**/*.yml' \
'workflows/**/*.yaml' \
'workflows/**/*.lock.yml' \
'.github/*' \
'.github/**')
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The forbidden-file check relies on origin/${{ github.base_ref }}...HEAD and --diff-filter=ACM. In Actions this ref can be missing/ambiguous depending on checkout mode, and the filter also ignores deletions/renames. Consider diffing ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} (or ${{ github.event.pull_request.base.sha }}...${{ github.sha }}) and either removing --diff-filter or including D/R so forbidden deletions/renames are also caught. Also, this currently only blocks *.yml/*.yaml/*.lock.yml under workflows/**; the PR description says all such files should be rejected for workflow contributions—please align implementation and docs.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +46 to +49
- name: Comment on PR
if: failure()
uses: marocchino/sticky-pull-request-comment@v2
with:
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

This PR-commenting step runs unconditionally on failure, but pull_request workflows from forks typically don't have permission to write PR comments, which will make the job fail noisily. Mirror the pattern used in validate-readme.yml (gate on github.event.pull_request.head.repo.permissions.push == true, and otherwise log the message to the workflow output).

This issue also appears on line 108 of the same file.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

uses: actions/checkout@v4

- name: Install gh-aw CLI
uses: github/gh-aw/actions/setup-cli@main
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

github/gh-aw/actions/setup-cli@main is a moving ref. Pin to a tagged release or a commit SHA to reduce supply-chain risk and improve reproducibility of CI runs.

Suggested change
uses: github/gh-aw/actions/setup-cli@main
uses: github/gh-aw/actions/setup-cli@v1.0.0

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aaronpowell are we ok with using main from a GitHub Inc. maintained action?

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.

1 participant