Update webhook and setup

This commit is contained in:
shekhar-cis 2023-01-02 20:30:09 +05:30
parent 5885c8cbbe
commit 4f412af6d9
Signed by: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
2 changed files with 11 additions and 21 deletions

View File

@ -74,14 +74,14 @@ class TransifexHandler(BaseHookHandler):
# Only handle potential new stuff, ignore close/.
# Merge itself is handled by the regular branch push message
if action not in ['opened', 'synchronized', 'edited', 'reopened']:
log.msg("Gitea Pull Request event '{}' ignored".format(action))
log.msg("Transifex Pull Request event '{}' ignored".format(action))
return []
pull_request = payload['pull_request']
if not pull_request['mergeable']:
log.msg("Gitea Pull Request ignored because it is not mergeable.")
log.msg("Transifex Pull Request ignored because it is not mergeable.")
return []
if pull_request['merged']:
log.msg("Gitea Pull Request ignored because it is already merged.")
log.msg("Transifex Pull Request ignored because it is already merged.")
return []
timestamp = dateparse(pull_request['updated_at'])
base = pull_request['base']
@ -189,5 +189,4 @@ class TransifexHandler(BaseHookHandler):
return (changes, 'transifex')
# Plugin name
transifex = TransifexHandler

View File

@ -8,30 +8,21 @@ with open("README.md", "r") as fh:
VERSION = "1.7.2"
setup(name='buildbot-gitea',
setup(name='buildbot-transifex',
version=VERSION,
description='buildbot plugin for integration with Gitea.',
author='Marvin Pohl',
author_email='hello@lab132.com',
url='https://github.com/lab132/buildbot-gitea',
long_description=long_description,
description='buildbot plugin for integration with transifex.',
author='',
author_email='',
url='',
long_description='Transifex webhook',
long_description_content_type="text/markdown",
packages=['buildbot_gitea'],
packages=['buildbot_transifex'],
install_requires=[
"buildbot>=3.0.0"
],
entry_points={
"buildbot.webhooks": [
"gitea = buildbot_gitea.webhook:gitea"
],
"buildbot.steps": [
"Gitea = buildbot_gitea.step_source:Gitea"
],
"buildbot.reporters": [
"GiteaStatusPush = buildbot_gitea.reporter:GiteaStatusPush"
],
"buildbot.util": [
"GiteaAuth = buildbot_gitea.auth:GiteaAuth"
"transifex = buildbot_transifex.webhook:transifex"
]
},
classifiers=[