From a6073c4ce320e7d3c78aa3e61ae7e0bd4c5d42e7 Mon Sep 17 00:00:00 2001 From: Sergei Petrosian Date: Tue, 29 Aug 2023 10:00:14 +0200 Subject: [PATCH] Apply latest changes for README conversion * Remove badges from README.md prior to converting to HTML * Replace Commitlint with PR Title Lint * Lint all markdown files except for CHANGELOG.md not just README.md * Use woke form from linux-system-roles --- .github/workflows/build_docs.yml | 3 +++ .github/workflows/markdownlint.yml | 9 +++++++-- .../workflows/{commitlint.yml => pr-title-lint.yml} | 10 +++++----- .github/workflows/test_converting_readme.yml | 5 ++++- .github/workflows/woke.yml | 11 ++++++----- CODE_OF_CONDUCT.md | 6 +++--- 6 files changed, 28 insertions(+), 16 deletions(-) rename .github/workflows/{commitlint.yml => pr-title-lint.yml} (70%) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 13efaab..6ddeb1a 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -75,6 +75,9 @@ jobs: - name: Ensure that version and docs directories exist run: mkdir -p ${{ env.RELEASE_VERSION }} docs + - name: Remove badges from README.md prior to converting to HTML + run: sed -i '1,8 {/^\[\!\[.*/d}' ref_branch/README.md + - name: Convert README.md to HTML and save to the version directory uses: docker://pandoc/core:latest with: diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 98e3c4c..ad00b4d 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -27,8 +27,13 @@ jobs: - name: Check out code uses: actions/checkout@v3 - - name: Lint README.md + # CHANGELOG.md is generated automatically from PR titles and descriptions + # It might have issues but they are not critical + - name: Lint all markdown files except for CHANGELOG.md uses: docker://avtodev/markdown-lint:master with: - args: README.md + args: >- + --ignore=CHANGELOG.md + --ignore=tests/roles/ansible-sshd/CHANGELOG.md + **/*.md config: .markdownlint.yaml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/pr-title-lint.yml similarity index 70% rename from .github/workflows/commitlint.yml rename to .github/workflows/pr-title-lint.yml index e76a0b2..19d8e7d 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/pr-title-lint.yml @@ -1,4 +1,4 @@ -name: Commitlint +name: PR Title Lint on: # yamllint disable-line rule:truthy pull_request: types: @@ -25,7 +25,7 @@ jobs: run: npm install @commitlint/config-conventional @commitlint/cli - name: Run commitlint on PR title - run: >- - echo '${{ github.event.pull_request.title }}' | - npx commitlint --verbose - + env: + PR_TITLE: ${{ github.event.pull_request.title }} + # Echo from env variable to avoid bash errors with extra characters + run: echo "$PR_TITLE" | npx commitlint --verbose diff --git a/.github/workflows/test_converting_readme.yml b/.github/workflows/test_converting_readme.yml index e545613..2c3d08e 100644 --- a/.github/workflows/test_converting_readme.yml +++ b/.github/workflows/test_converting_readme.yml @@ -28,7 +28,10 @@ jobs: - name: Check out code uses: actions/checkout@v3 - - name: Convert README.md to HTML and save to the version directory + - name: Remove badges from README.md prior to converting to HTML + run: sed -i '1,8 {/^\[\!\[.*/d}' README.md + + - name: Convert README.md to HTML uses: docker://pandoc/core:latest with: args: >- diff --git a/.github/workflows/woke.yml b/.github/workflows/woke.yml index 6752ff5..c8322e4 100644 --- a/.github/workflows/woke.yml +++ b/.github/workflows/woke.yml @@ -1,18 +1,19 @@ # yamllint disable rule:line-length -name: Check for non-inclusive language +name: Woke on: # yamllint disable-line rule:truthy - pull_request jobs: woke: - name: woke + name: Detect non-inclusive language runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - - name: woke - uses: get-woke/woke-action@v0 + - 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" + 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 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 6340074..961b20f 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at matt@willsher.systems. All +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. @@ -68,9 +68,9 @@ members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +available at [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq +