-
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
Changes from all commits
f62c04f
cff88f3
c4b9a73
40f557d
b2bc9ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# yamllint disable rule:line-length | ||
name: Woke | ||
on: # yamllint disable-line rule:truthy | ||
- pull_request | ||
jobs: | ||
woke: | ||
name: Detect non-inclusive language | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: {{ gha_checkout_action }} | ||
|
||
- name: Run lsr-woke-action | ||
# Originally, uses: get-woke/woke-action@v0 | ||
uses: linux-system-roles/lsr-woke-action@main | ||
with: | ||
woke-args: "-c https://raw.githubusercontent.com/linux-system-roles/tox-lsr/main/src/tox_lsr/config_files/woke.yml --count-only-error-for-failure" | ||
# Cause the check to fail on any broke rules | ||
fail-on-error: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,37 @@ | |
__present_python_templates + __present_shellcheck_templates)) + | ||
([__role_template_dir] | product(__role_present_templates)) }}" | ||
|
||
- name: Find workflows to create badges for | ||
find: | ||
paths: "{{ git_dir }}/.github/workflows" | ||
file_type: file | ||
excludes: | ||
- ansible-managed-var-comment.yml | ||
- ansible-plugin-scan.yml | ||
- build_docs.yml | ||
- changelog_to_tag.yml | ||
- pr-title-lint.yml | ||
- test_converting_readme.yml | ||
- weekly_ci.yml | ||
register: find | ||
|
||
- name: Ensure badges in README.md | ||
lineinfile: | ||
path: "{{ git_dir }}/README.md" | ||
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 commentThe 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 commentThe 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. |
||
(https://github.com/linux-system-roles/{{ inventory_hostname }}/actions/workflows/{{ file.path | basename }}/badge.svg)]\ | ||
(https://github.com/linux-system-roles/{{ inventory_hostname }}/actions/workflows/{{ file.path | basename }})\ | ||
{{- ' ' if not loop.last else '' -}}\ | ||
{% endfor %} | ||
{{- ' ' if present_badges | d([]) | length > 0 else '' -}}\ | ||
{%- for badge in present_badges | d([]) -%} | ||
{{ badge }}\ | ||
{{ ' ' if not loop.last else '' }}\ | ||
{% endfor %}" | ||
|
||
- name: Create git commit, PR | ||
changed_when: false | ||
shell: | ||
|
@@ -155,6 +186,7 @@ | |
for file in {{ __all_present | join(" ") }}; do | ||
git add "$file" | ||
done | ||
git add README.md | ||
for file in {{ __all_absent | join(" ") }}; do | ||
if [ ! -f "$file" ]; then | ||
echo WARNING: file to be deleted was not found: "$file" | ||
|
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.