{"id":22351880,"url":"https://github.com/screwdriver-cd/workflow-parser","last_synced_at":"2025-10-09T15:51:38.756Z","repository":{"id":44882845,"uuid":"106349809","full_name":"screwdriver-cd/workflow-parser","owner":"screwdriver-cd","description":"Calculate a directed graph workflow based on a pipeline config","archived":false,"fork":false,"pushed_at":"2025-06-17T21:53:39.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-07-06T13:50:26.075Z","etag":null,"topics":["parser"],"latest_commit_sha":null,"homepage":"https://cd.screwdriver.cd/pipelines/529","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/screwdriver-cd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-10T00:37:34.000Z","updated_at":"2025-06-17T21:52:08.000Z","dependencies_parsed_at":"2024-01-18T22:05:32.567Z","dependency_job_id":"923f3e1c-d14b-44ac-94d9-afd765f711e2","html_url":"https://github.com/screwdriver-cd/workflow-parser","commit_stats":{"total_commits":46,"total_committers":13,"mean_commits":"3.5384615384615383","dds":0.8478260869565217,"last_synced_commit":"36f8af6a156b8f2405328ea6225028e4f97eb6ba"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/screwdriver-cd/workflow-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fworkflow-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fworkflow-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fworkflow-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fworkflow-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/screwdriver-cd","download_url":"https://codeload.github.com/screwdriver-cd/workflow-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fworkflow-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266278125,"owners_count":23904036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser"],"created_at":"2024-12-04T12:16:13.710Z","updated_at":"2025-10-09T15:51:33.689Z","avatar_url":"https://github.com/screwdriver-cd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workflow Parser\n[![Version][npm-image]][npm-url] ![Downloads][downloads-image] [![Build Status][status-image]][status-url] [![Open Issues][issues-image]][issues-url] ![License][license-image]\n\n\u003e Parses and converts pipeline configuration into a workflow graph\n\n## Usage\n\n```bash\nnpm install screwdriver-workflow-parser\n```\n\n```\nconst { getWorkflow, getNextJobs, hasCycle } = require('screwdriver-workflow-parser');\n\n// Calculate the directed graph workflow from a pipeline config (and parse legacy workflows)\nconst workflowGraph = getWorkflow(pipelineConfig, { useLegacy: true });\n\n/* \n{ \n    nodes: [{ name: '~pr'}, { name: '~commit'}, { name: 'main' }], \n    edges: [{ src: '~pr', dest: 'main'}, { src: '~commit', dest: 'main'}] \n}\n*/\n\n// Get a list of job names to start as a result of a commit event, e.g. [ 'a', 'b' ]\nconst commitJobsToTrigger = getNextJobs(workflowGraph, { trigger: '~commit' });\n\n// Get a list of job names to start as a result of a pull-request event, e.g. [ 'PR-123:a' ]\nconst prJobsToTrigger = getNextJobs(workflowGraph, { trigger: '~pr', prNum: 123 });\n\n// Check to see if a given workflow graph has a loop in it. A -\u003e B -\u003e A\nif (hasCycle(workflowGraph)) {\n    console.error('Graph contains a loop.');\n}\n```\n\n## Testing\n\n```bash\nnpm test\n```\n\n## License\n\nCode licensed under the BSD 3-Clause license. See LICENSE file for terms.\n\n[npm-image]: https://img.shields.io/npm/v/screwdriver-workflow-parser.svg\n[npm-url]: https://npmjs.org/package/screwdriver-workflow-parser\n[downloads-image]: https://img.shields.io/npm/dt/screwdriver-workflow-parser.svg\n[license-image]: https://img.shields.io/npm/l/screwdriver-workflow-parser.svg\n[issues-image]: https://img.shields.io/github/issues/screwdriver-cd/workflow-parser.svg\n[issues-url]: https://github.com/screwdriver-cd/workflow-parser/issues\n[status-image]: https://cd.screwdriver.cd/pipelines/529/badge\n[status-url]: https://cd.screwdriver.cd/pipelines/529\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Fworkflow-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrewdriver-cd%2Fworkflow-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Fworkflow-parser/lists"}