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

Open
opened 2025-11-02 11:01:17 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @key262yek on GitHub (Jan 25, 2025).

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.

a9a064dfa1/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

Originally created by @key262yek on GitHub (Jan 25, 2025). ### 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 ```ts } 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_
GiteaMirror added the topic/gitea-actionstype/proposal labels 2025-11-02 11:01:17 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14048