Skip to content

Report structurally invalid workflows to users (#37116)#37164

Merged
silverwind merged 1 commit intogo-gitea:release/v1.26from
GiteaBot:backport-37116-v1.26
Apr 9, 2026
Merged

Report structurally invalid workflows to users (#37116)#37164
silverwind merged 1 commit intogo-gitea:release/v1.26from
GiteaBot:backport-37116-v1.26

Conversation

@GiteaBot
Copy link
Copy Markdown
Collaborator

@GiteaBot GiteaBot commented Apr 9, 2026

Backport #37116 by @bircni

model.ReadWorkflow succeeds for YAML that is syntactically valid but fails deeper parsing in jobparser.Parse (e.g. blank lines inside run: | blocks cause a SetJob round-trip error). Add ValidateWorkflowContent which runs the full jobparser.Parse to catch these cases, and use it in the file view, the actions workflow list, and the workflow detection loop so users see the error instead of silently getting a 500 or a dropped workflow.

Fixes #37115

`model.ReadWorkflow` succeeds for YAML that is syntactically valid but
fails deeper parsing in `jobparser.Parse` (e.g. blank lines inside `run:
|` blocks cause a SetJob round-trip error). Add
`ValidateWorkflowContent` which runs the full `jobparser.Parse` to catch
these cases, and use it in the file view, the actions workflow list, and
the workflow detection loop so users see the error instead of silently
getting a 500 or a dropped workflow.

Fixes go-gitea#37115
Signed-off-by: Nicolas <bircni@icloud.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added the modifies/go Pull requests that update Go code label Apr 9, 2026
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 9, 2026
@GiteaBot GiteaBot added this to the 1.26.0 milestone Apr 9, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 9, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 9, 2026
@silverwind silverwind enabled auto-merge (squash) April 9, 2026 20:47
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 9, 2026
@silverwind silverwind merged commit 4eca71d into go-gitea:release/v1.26 Apr 9, 2026
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants