fix(ci): tolerate services:/container: so real workflows trigger#382
Merged
Conversation
Found by pushing the real Corevice/open-git repo to a self-hosted instance: its ci.yml (and any workflow using `services:`) never triggered. The workflow parser declared `Job.Services` as map[string]string and `Job.Container` as string, but GitHub's `services.<id>` is always a mapping (image/env/ports/ options) and `container` may be a mapping too. Decoding failed with "cannot unmarshal !!map into string", so ParseWorkflow returned an error and the trigger silently skipped the whole workflow. These fields aren't executed by our simplified runner, so capture them as raw yaml.Node instead of rejecting them. All eight real open-git workflows now parse (previously ci.yml, and any with services, did not). Regression test covers a workflow with a map-form container and a postgres service parsing via both ParseWorkflow and ParseWorkflowFull.
🍊 Orange Codens レビューサービス/コンテナフィールドを 🔒 セキュリティ: 本 PR はワークフローパーサーの堅牢性を改善する修正です。 🟡 medium: 1 / ⚪ info: 1 その他の指摘 (2 件)
head: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by pushing the real Corevice/open-git repo to a self-hosted instance: its
ci.yml(and any workflow usingservices:) never triggered.The parser declared
Job.Servicesasmap[string]stringandJob.Containerasstring, but GitHub'sservices.<id>is always a mapping (image/env/ports/options) andcontainermay be a mapping too. Decoding failed withcannot unmarshal !!map into string, soParseWorkflowerrored and the trigger silently skipped the whole workflow — it never ran.These fields aren't executed by our simplified runner, so capture them as raw
yaml.Nodeinstead of rejecting them. All eight real open-git workflows now parse (previouslyci.ymland any with services did not). Regression test added.