Browse Source

fix sanity

main
Markus Bergholz 6 months ago
parent
commit
d01b610826
No known key found for this signature in database
GPG Key ID: B45724801354B174
  1. 5
      plugins/modules/gitea_pull_request_comment.py
  2. 6
      plugins/modules/gitlab_merge_request_comment.py

5
plugins/modules/gitea_pull_request_comment.py

@ -50,7 +50,6 @@ EXAMPLES = '''
'''
from ansible.module_utils.basic import AnsibleModule
import requests
import os
@ -70,6 +69,10 @@ def main():
issue_id = os.environ.get('CI_PULL_REQUEST')
if issue_id and api_token:
try:
import requests
except ImportError as error:
module.log(error)
repo = os.environ.get('CI_REPO')

6
plugins/modules/gitlab_merge_request_comment.py

@ -50,7 +50,6 @@ EXAMPLES = '''
'''
from ansible.module_utils.basic import AnsibleModule
import requests
import os
@ -70,6 +69,11 @@ def main():
_mr_id = os.environ.get('CI_OPEN_MERGE_REQUESTS')
if _mr_id and api_token:
try:
import requests
except ImportError as error:
module.log(error)
mr_id = _mr_id.split('!')[-1]
pr_id = os.environ.get('CI_PROJECT_ID')
gitlab_mr_url = f'https://{api_url}/api/v4/projects/{pr_id}/merge_requests/{mr_id}/notes'

Loading…
Cancel
Save