mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-24 12:25:11 +00:00
Add Agentic Workflows as a new resource type
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>
This commit is contained in:
@@ -253,6 +253,67 @@ function parseHookMetadata(hookPath) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse workflow metadata from a workflow folder
|
||||
* @param {string} workflowPath - Path to the workflow folder
|
||||
* @returns {object|null} Workflow metadata or null on error
|
||||
*/
|
||||
function parseWorkflowMetadata(workflowPath) {
|
||||
return safeFileOperation(
|
||||
() => {
|
||||
const readmeFile = path.join(workflowPath, "README.md");
|
||||
if (!fs.existsSync(readmeFile)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const frontmatter = parseFrontmatter(readmeFile);
|
||||
|
||||
// Validate required fields
|
||||
if (!frontmatter?.name || !frontmatter?.description) {
|
||||
console.warn(
|
||||
`Invalid workflow at ${workflowPath}: missing name or description in frontmatter`
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Extract triggers from frontmatter if present
|
||||
const triggers = frontmatter.triggers || [];
|
||||
|
||||
// List bundled assets (all files except README.md), recursing through subdirectories
|
||||
const getAllFiles = (dirPath, arrayOfFiles = []) => {
|
||||
const files = fs.readdirSync(dirPath);
|
||||
|
||||
files.forEach((file) => {
|
||||
const filePath = path.join(dirPath, file);
|
||||
if (fs.statSync(filePath).isDirectory()) {
|
||||
arrayOfFiles = getAllFiles(filePath, arrayOfFiles);
|
||||
} else {
|
||||
const relativePath = path.relative(workflowPath, filePath);
|
||||
if (relativePath !== "README.md") {
|
||||
arrayOfFiles.push(relativePath.replace(/\\/g, "/"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return arrayOfFiles;
|
||||
};
|
||||
|
||||
const assets = getAllFiles(workflowPath).sort();
|
||||
|
||||
return {
|
||||
name: frontmatter.name,
|
||||
description: frontmatter.description,
|
||||
triggers,
|
||||
tags: frontmatter.tags || [],
|
||||
assets,
|
||||
path: workflowPath,
|
||||
};
|
||||
},
|
||||
workflowPath,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a generic YAML file (used for tools.yml and other config files)
|
||||
* @param {string} filePath - Path to the YAML file
|
||||
@@ -276,6 +337,7 @@ export {
|
||||
parseFrontmatter,
|
||||
parseSkillMetadata,
|
||||
parseHookMetadata,
|
||||
parseWorkflowMetadata,
|
||||
parseYamlFile,
|
||||
safeFileOperation,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user