Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(action): issue change title notifications #33050

Merged
merged 13 commits into from
Dec 31, 2024
Merged

Conversation

appleboy
Copy link
Member

  • Add IssueChangeTitle method to handle issue title changes
  • Add notifyIssueChangeWithTitleOrContent method to generalize notification handling for issue title or content changes
  • Replace hardcoded api.HookIssueEdited with dynamic action parameter in notification payloads

action file as below:

name: Semantic Pull Request

on:
  pull_request_target:
    types: [edited]

- Add `IssueChangeTitle` method to handle issue title changes
- Add `notifyIssueChangeWithTitleOrContent` method to generalize notification handling for issue title or content changes
- Replace hardcoded `api.HookIssueEdited` with dynamic `action` parameter in notification payloads

Signed-off-by: Bo-Yi Wu <[email protected]>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 30, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 30, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Dec 30, 2024
@appleboy appleboy added this to the 1.24.0 milestone Dec 30, 2024
@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 Dec 30, 2024
@lunny lunny added the backport/v1.23 This PR should be backported to Gitea 1.23 label Dec 30, 2024
@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 Dec 31, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 31, 2024
@wxiaoguang wxiaoguang enabled auto-merge (squash) December 31, 2024 11:39
@wxiaoguang wxiaoguang disabled auto-merge December 31, 2024 11:42
@pull-request-size pull-request-size bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 31, 2024
@wxiaoguang
Copy link
Contributor

And the "action" should be hard-coded to api.HookIssueEdited, because "title change" and "content change" both are "api.HookIssueEdited" (the same to other notifiers)

To distinguish them, the proper approach is to use the Changes field in api.PullRequestPayload (not needed at the moment so no need to implement it now)

@wxiaoguang wxiaoguang enabled auto-merge (squash) December 31, 2024 11:47
@wxiaoguang wxiaoguang merged commit 6c89de4 into go-gitea:main Dec 31, 2024
26 checks passed
GiteaBot added a commit to GiteaBot/gitea that referenced this pull request Dec 31, 2024
- Add `IssueChangeTitle` method to handle issue title changes
- Add `notifyIssueChangeWithTitleOrContent` method to generalize
notification handling for issue title or content changes

action file as below:

```yaml
name: Semantic Pull Request

on:
  pull_request_target:
    types: [edited]
```

---------

Signed-off-by: Bo-Yi Wu <[email protected]>
Co-authored-by: Giteabot <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
@GiteaBot GiteaBot added backport/done All backports for this PR have been created and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Dec 31, 2024
wxiaoguang added a commit that referenced this pull request Dec 31, 2024
Backport #33050 by appleboy

action file as below:

```yaml
name: Semantic Pull Request

on:
  pull_request_target:
    types: [edited]
```

Signed-off-by: Bo-Yi Wu <[email protected]>
Co-authored-by: Bo-Yi Wu <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
@appleboy appleboy deleted the actions branch January 1, 2025 10:16
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 2, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  unset XDG_HOME_CONFIG as gitea manages configuration locations (go-gitea#33067)
  Refactor repo-new.ts (go-gitea#33070)
  Refactor pull-request compare&create page (go-gitea#33071)
  feat: link to nuget dependencies (go-gitea#26554)
  Remove some unnecessary template helpers (go-gitea#33069)
  Inherit submodules from template repository content (go-gitea#16237)
  [skip ci] Updated translations via Crowdin
  feat(action): issue change title notifications (go-gitea#33050)
  Use project's redirect url instead of composing url (go-gitea#33058)
  Fix unittest and repo create bug (go-gitea#33061)
  Fix locale type (go-gitea#33059)
  Refactor maven package registry (go-gitea#33049)
  Optimize the installation page (go-gitea#32994)
  [Feature] Private README.md for organization (go-gitea#32872)
  Make issue suggestion work for new PR page (go-gitea#33035)
  Add IntelliJ Gateway's .uuid to gitignore (go-gitea#33052)
@appleboy appleboy modified the milestones: 1.24.0, 1.23.0 Jan 3, 2025
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.23 This PR should be backported to Gitea 1.23 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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants