Browse Source

sanity fixes

main
Markus Bergholz 6 months ago
parent
commit
520959ae74
No known key found for this signature in database
GPG Key ID: B45724801354B174
  1. 9
      galaxy.yml
  2. 5
      plugins/modules/gitea_pull_request_comment.py
  3. 5
      plugins/modules/gitlab_merge_request_comment.py
  4. 1
      requirements.txt

9
galaxy.yml

@ -43,13 +43,13 @@ tags: []
dependencies: {}
# The URL of the originating SCM repository
repository: https://git.osuv.de/ansible_collections/devops
repository: https://git.osuv.de/ansible_collections/markuman.devops
# The URL to any online docs
documentation: https://git.osuv.de/ansible_collections/devops
documentation: https://git.osuv.de/ansible_collections/markuman.devops
# The URL to the homepage of the collection/project
homepage: https://git.osuv.de/ansible_collections/devops
homepage: https://git.osuv.de/ansible_collections/markuman.devops
# The URL to the collection issue tracker
issues: https://github.com/markuman/markuman.devops/issue
@ -58,5 +58,4 @@ issues: https://github.com/markuman/markuman.devops/issue
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
# and '.git' are always filtered
build_ignore: []
build_ignore: []

5
plugins/modules/gitea_pull_request_comment.py

@ -33,6 +33,8 @@ options:
- URL of your gitea instance
required: true
type: str
requirements:
- requests
'''
EXAMPLES = '''
@ -72,7 +74,6 @@ def main():
repo = os.environ.get('CI_REPO')
gitea_url = f'https://{api_url}/api/v1/repos/{repo}/issues/{issue_id}/comments'
q(gitea_url)
headers = {
'Authorization': f'token {api_token}',
@ -84,7 +85,7 @@ def main():
'body': comment
}
x = requests.post(gitea_url, json = data, headers = headers)
x = requests.post(gitea_url, json=data, headers=headers)
change = False
if x.status_code == 201:

5
plugins/modules/gitlab_merge_request_comment.py

@ -26,12 +26,15 @@ options:
description:
- Your gitlab url
required: true
type: str
api_token:
description:
- API Token.
- If not provided, it's read from ENV ANSIBLE_GITLAB_API_TOKEN
required: false
type: str
requirements:
- requests
'''
EXAMPLES = '''
@ -80,7 +83,7 @@ def main():
'body': comment
}
x = requests.post(gitlab_mr_url, data = data, headers = headers)
x = requests.post(gitlab_mr_url, data=data, headers=headers)
change = False
if x.status_code == 201:

1
requirements.txt

@ -0,0 +1 @@
requiests
Loading…
Cancel
Save