Skip to content

'before' and 'after' key in action event_data #33395

Open
@key262yek

Description

@key262yek

Feature Description

When a PR is synchronized, GitHub's event data includes before and after keys, representing the head commit hashes of the previous and current pushes. However, Gitea's equivalent does not provide this information.

This is essential for developing an AI code-review action that reviews only the current changes by parsing the diff between two commit SHAs.

https://github.com/aidar-freeed/ai-codereviewer/blob/a9a064dfa1db8c83f40ef63f6e247fa09c935ed6/src/main.ts#L197-L209

  } else if (eventData.action === "synchronize") {
    const newBaseSha = eventData.before;
    const newHeadSha = eventData.after;


    const response = await octokit.repos.compareCommits({
      headers: {
        accept: "application/vnd.github.v3.diff",
      },
      owner: prDetails.owner,
      repo: prDetails.repo,
      base: newBaseSha,
      head: newHeadSha,
    });

Is there any way to get this information? or do you have any plan to provide such information?

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/gitea-actionsrelated to the actions of Giteatype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions