Skip to content

fix(actions): populate github.event for scheduled runs#38446

Merged
silverwind merged 3 commits into
go-gitea:mainfrom
silverwind:actions-schedule-event-payload
Jul 14, 2026
Merged

fix(actions): populate github.event for scheduled runs#38446
silverwind merged 3 commits into
go-gitea:mainfrom
silverwind:actions-schedule-event-payload

Conversation

@silverwind

@silverwind silverwind commented Jul 14, 2026

Copy link
Copy Markdown
Member

Scheduled runs stored a null event payload, so github.event.repository/sender/organization were empty in scheduled workflows. Every other event carries them, and so does GitHub Actions. CreateScheduleTask now synthesizes them.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 14, 2026
@silverwind silverwind added topic/gitea-actions related to the actions of Gitea backport/v1.27 This PR should be backported to Gitea 1.27 labels Jul 14, 2026
A scheduled run stored a nil event payload, so github.event.repository,
.sender and .organization were absent in scheduled workflows — unlike
every other event and unlike GitHub Actions. Synthesize them when
materializing the run, fresh per fire.

Co-Authored-By: Claude (Opus 4.8) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates scheduled Actions runs so github.event is populated with repository, sender, and (when applicable) organization, aligning scheduled runs with the payload shape other events provide and what GitHub Actions exposes.

Changes:

  • Synthesize github.event.repository/sender/organization for schedule-triggered runs in CreateScheduleTask.
  • Extend withScheduleInEventPayload to merge arbitrary fields into the event payload (in addition to schedule).
  • Update and expand unit tests for withScheduleInEventPayload to cover merged fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
services/actions/schedule_tasks.go Synthesizes schedule event payload fields and merges them into the stored event JSON.
services/actions/schedule_tasks_test.go Adapts tests to new helper signature and adds coverage for merged repository/sender/organization fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/actions/schedule_tasks.go
@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 Jul 14, 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 Jul 14, 2026
@silverwind silverwind merged commit 0e4d935 into go-gitea:main Jul 14, 2026
24 checks passed
@silverwind silverwind deleted the actions-schedule-event-payload branch July 14, 2026 16:30
@GiteaBot GiteaBot added this to the 28.0.0 milestone Jul 14, 2026
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/done All backports for this PR have been created backport/v1.27 This PR should be backported to Gitea 1.27 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.

5 participants