Skip to content

Fix scheduled action panic with null event payload (#37459)#37466

Merged
wxiaoguang merged 1 commit intogo-gitea:release/v1.26from
GiteaBot:backport-37459-v1.26
Apr 28, 2026
Merged

Fix scheduled action panic with null event payload (#37459)#37466
wxiaoguang merged 1 commit intogo-gitea:release/v1.26from
GiteaBot:backport-37459-v1.26

Conversation

@GiteaBot
Copy link
Copy Markdown
Collaborator

Backport #37459 by @cyphercodes

This fixes the scheduled action panic when an event payload is JSON null by initializing the payload map before adding schedule. It also adds regression coverage for the null-payload case.

Fixes #37447.

Testing:

  • go test -tags 'sqlite sqlite_unlock_notify' ./services/actions -run '^TestWithScheduleInEventPayload$' -count=1
    • Local note: this agent ran the command as root with a temporary GITEA_TEST_CONF=custom/conf/app-test-root.ini file that only set I_AM_BEING_UNSAFE_RUNNING_AS_ROOT = true.

Authorship: cyphercodes; AI assistance disclosed: Hermes Agent (GPT-5.5).

This fixes the scheduled action panic when an event payload is JSON
`null` by initializing the payload map before adding `schedule`. It also
adds regression coverage for the null-payload case.

Fixes go-gitea#37447.

Testing:
- `go test -tags 'sqlite sqlite_unlock_notify' ./services/actions -run
'^TestWithScheduleInEventPayload$' -count=1`
- Local note: this agent ran the command as root with a temporary
`GITEA_TEST_CONF=custom/conf/app-test-root.ini` file that only set
`I_AM_BEING_UNSAFE_RUNNING_AS_ROOT = true`.

Authorship: cyphercodes; AI assistance disclosed: Hermes Agent
(GPT-5.5).

---------

Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com>
Co-authored-by: Hermes Agent (GPT-5.5) <hermes-agent@users.noreply.github.com>
Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
Co-authored-by: Giteabot <teabot@gitea.io>
@GiteaBot GiteaBot added topic/gitea-actions related to the actions of Gitea type/bug lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 28, 2026
@GiteaBot GiteaBot added this to the 1.26.2 milestone Apr 28, 2026
@GiteaBot GiteaBot requested review from lunny and silverwind April 28, 2026 04:36
@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 28, 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 28, 2026
@wxiaoguang wxiaoguang enabled auto-merge (squash) April 28, 2026 04:53
@wxiaoguang wxiaoguang merged commit c4a1ff7 into go-gitea:release/v1.26 Apr 28, 2026
26 checks passed
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. topic/gitea-actions related to the actions of Gitea type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants