-
Notifications
You must be signed in to change notification settings - Fork 8
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
ci: Make badges consistent, run markdownlint all .md files #42
Conversation
spetrosi
commented
Aug 18, 2023
- Consistently generate badges for GH workflows in roles RHELPLAN-146921
- Run markdownlint on all .md files
- Rename woke action to Woke for a pretty badge
playbooks/update_files.yml
Outdated
firstmatch: true | ||
line: "\n \ | ||
{%- if 'python_roles' in group_names -%}\ | ||
![CodeQL](https://github.com/linux-system-roles/{{ inventory_hostname }}/workflows/CodeQL/badge.svg) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be cool if we could somehow associate each badge with an action so that we didn't have this hardcoded list here.
The journald role has all of the badges in the title line - see https://github.com/linux-system-roles/journald/blob/main/README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you meant under "associate each badge with an action", but I found a way to automatically generate these badges from existing workflow, excluding some of them that do not require a badge. And also added present_badges
in roles' host_vars to define role-specific badges. Tested it with network in linux-system-roles/network#631 so far. Please take a look.
9b7e6c3
to
e984c9b
Compare
- Consistently generate badges for GH workflows in roles RHELPLAN-146921 - Run markdownlint on all .md files - Rename woke action to Woke for a pretty badge
e984c9b
to
f62c04f
Compare
* Only update the badges line with lineinfile * Use linux-system-roles/lsr-woke-action * For metrics, ignore vendor directory with markdownlint
present_badges: | ||
- "[![Coverage Status](https://coveralls.io/repos/github/linux-system-roles/network/badge.svg)](https://coveralls.io/github/linux-system-roles/network)" | ||
- "[![Code Style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)" | ||
- "[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/linux-system-roles/network.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/linux-system-roles/network/context:python)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok - but note that lgtm.com is deprecated and will be removed at some point https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just used what's in the network role already. We can revisit it later.
regex: \[\!.* | ||
firstmatch: true | ||
line: "{%-for file in find.files -%}\ | ||
[![{{ file.path | basename }}]\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means the badge will have the filename instead of a "user friendly" name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, GitHub renders this fine to the name of the workflow, and it's easier to get the filename than to read it's name from a file.