Compare commits

..

6 Commits

Author SHA1 Message Date
5feba1c27c Merge pull request 'fix: No problems found' (#6) from fix-5-no-promlems-approve-pr into development
Reviewed-on: #6
2025-07-12 14:11:40 +00:00
Jon
e03a201c30 chore: linting fix
All checks were successful
Lint (Pull Request) / lint (pull_request) Successful in 29s
ref: #6
2025-07-12 23:38:11 +09:30
Jon
ec9304fdc5 fix(problem_matcher): correct regex for when pylint content is not available
All checks were successful
Lint (Pull Request) / lint (pull_request) Successful in 29s
ref: #6
2025-07-12 23:35:04 +09:30
Jon
f10663a2d5 ci: add ansible-lint
All checks were successful
Lint (Pull Request) / lint (pull_request) Successful in 43s
ref: #6
2025-07-12 22:43:03 +09:30
Jon
eb11625b66 fix(problem_matcher): On approval body is required contrary to docs
All checks were successful
Lint (Pull Request) / lint (pull_request) Successful in 9s
ref: #6 #5
2025-07-12 22:35:02 +09:30
Jon
5e69fb2807 chore: linting fixes
All checks were successful
Lint (Pull Request) / lint (pull_request) Successful in 19s
ref: #6
2025-07-12 21:44:17 +09:30
6 changed files with 30 additions and 7 deletions

View File

@ -12,7 +12,9 @@ commitizen:
- fix
- test
- refactor
# yamllint disable rule:line-length
commit_parser: ^(?P<change_type>feat|fix|test|refactor|perf|BREAKING CHANGE)(?:\((?P<scope>[^()\r\n]*)\)|\()?(?P<breaking>!)?:\s(?P<message>.*)?
# yamllint enable rule:line-length
name: cz_customize
prerelease_offset: 1
tag_format: $version

View File

@ -13,16 +13,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Enable Matcher Service
run: |
echo "NFC_PROBLEM_MATCHER=${GITHUB_REF_NAME}";
- uses: actions/checkout@v3
- name: Install YAMLLint
run: pip install yamllint
- name: Run YAMLLint
run: |
echo "NFC_PROBLEM_MATCHER_TYPE=YAML-Lint"
yamllint -f github . || true
- name: Install Ansible-Lint
run: pip install ansible-lint
- name: Run Ansible-Lint
run: |
echo "NFC_PROBLEM_MATCHER_TYPE=pylint-json";
ansible-lint -f json . || true

View File

@ -74,4 +74,4 @@ rules:
level: error
type: unix
truthy: disable
truthy: disable

View File

@ -27,10 +27,12 @@
- name: Process Completed workflow_job
# yamllint disable rule:indentation
condition: >
event.meta.headers['X-GitHub-Event'] == 'workflow_job'
and
event.payload.action == 'completed'
# yamllint enable rule:indentation
actions:
- run_playbook:

View File

@ -144,8 +144,8 @@ regex = {
r'"description":\s*"(?P<description>[^"]+)",\s*'
r'"fingerprint":\s*"(?P<fingerprint>[^"]+)",\s*'
r'"location":\s*\{\s*"path":\s*"(?P<path>[^"]+)".+?'
r'"line[s]?":.+?(?P<line>\d+).*?\}},'
r'(?:\s"content":\s\{"body":\s"(?P<body>.+?)")?'
r'"line[s]?":.+?(?P<line>\d+).*?\}}'
r'(?:,\s"content":\s\{"body":\s"(?P<body>.+?)")?'
)
}
@ -284,10 +284,9 @@ for msg_type, value in review_body.items():
if len(api_body['comments']) == 0:
api_body.update({
'body': "G'day, I didn't find any problems to report on",
'event': 'APPROVE'
})
del api_body['body']
data = {

View File

@ -30,7 +30,9 @@
- name: Set required Facts
ansible.builtin.set_fact:
git_url_api: "{{ payload.repository.url | replace((gitea_replace_url | split('/api/'))[0], git_api_url) }}"
git_url_api: >-
{{ payload.repository.url |
replace((gitea_replace_url | split('/api/'))[0], git_api_url) }}
git_url_path_jobs: 'actions/jobs'
head_sha: "{{ payload.workflow_job.head_sha }}"
@ -51,7 +53,9 @@
- name: Fetch job log
ansible.builtin.uri:
url: "{{ git_url_api + '/' + git_url_path_jobs + '/' + payload.workflow_job.id | string + '/logs' }}"
url: >-
{{ git_url_api + '/' + git_url_path_jobs
+ '/' + payload.workflow_job.id | string + '/logs' }}
dest: /tmp/job.log
headers:
Authorization: token {{ lookup('env', 'GIT_API_TOKEN') }}
@ -119,9 +123,11 @@
timeout: 10
validate_certs: false
no_log: "{{ disable_logging }}"
# yamllint disable rule:indentation
when: >
http_get_pull_request.json.state | default('-') != 'closed'
and
http_get_pull_request.status | default(0) == 200
and
not http_get_pull_request.skipped | default(false) | bool
# yamllint enable rule:indentation