From f5184529298c6464f8829ef688025ac1a128eb61 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Mon, 7 Oct 2024 09:41:47 +0200 Subject: [PATCH 1/9] feat: Test the check file name step * based on feat/check_file_name branch from action repository --- ..._reusable_pr-antora-content-guidelines-checker.yml | 2 +- .github/workflows/pr-antora-checker-test.yml | 4 ++-- .../bonita/v2021.2/modules/module-01/nav.adoc | 1 + .../modules/module-01/pages/TestOfBadFileName.adoc | 11 +++++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 test/documentation-content/bonita/v2021.2/modules/module-01/pages/TestOfBadFileName.adoc diff --git a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml index 5a5b64a5c..b20b2edbd 100644 --- a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml +++ b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check - uses: bonitasoft/actions/packages/doc-contribs/pr-antora-content-guidelines-checker@v3 + uses: bonitasoft/actions/packages/doc-contribs/pr-antora-content-guidelines-checker@feat/check_file_name with: attributes-to-check: ':description:' files-to-check: 'adoc' diff --git a/.github/workflows/pr-antora-checker-test.yml b/.github/workflows/pr-antora-checker-test.yml index 7355d8e02..da81cd0c5 100644 --- a/.github/workflows/pr-antora-checker-test.yml +++ b/.github/workflows/pr-antora-checker-test.yml @@ -2,11 +2,11 @@ name: Contribution checks on test data on: # use pull_request event to test update done of the reusable workflow (update the branch of the reusable workflow as well in this case) - pull_request_target: + pull_request: paths: - '.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml' - '.github/workflows/pr-antora-checker-test.yml' - - 'test/documentation-content/**/*' + - 'test/documentation-content/bonita/v2021.2/**/*' jobs: check_antora_content_guidelines: diff --git a/test/documentation-content/bonita/v2021.2/modules/module-01/nav.adoc b/test/documentation-content/bonita/v2021.2/modules/module-01/nav.adoc index eb71b2179..66c5e1753 100644 --- a/test/documentation-content/bonita/v2021.2/modules/module-01/nav.adoc +++ b/test/documentation-content/bonita/v2021.2/modules/module-01/nav.adoc @@ -1 +1,2 @@ ** xref:index.adoc[module-01] +** xref:TestOfBadFileName.adoc[TestOfBadFileName] diff --git a/test/documentation-content/bonita/v2021.2/modules/module-01/pages/TestOfBadFileName.adoc b/test/documentation-content/bonita/v2021.2/modules/module-01/pages/TestOfBadFileName.adoc new file mode 100644 index 000000000..f2e2ccfb4 --- /dev/null +++ b/test/documentation-content/bonita/v2021.2/modules/module-01/pages/TestOfBadFileName.adoc @@ -0,0 +1,11 @@ += Module 01 + +xref:ROOT:old-page-01.adoc[link to ROOT old page 01]. + +xref:ROOT:page-01.adoc[link to ROOT page 01]. + + +xref:bonita:module-02:old-page01.adoc[link to module-02 old page 01]. + +xref:bonita:module-02:page01.adoc[link to module-02 page 01]. + From bd73fccdc841c683aa4787306a039c6056c1a607 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Mon, 7 Oct 2024 09:43:39 +0200 Subject: [PATCH 2/9] add description --- .../v2021.2/modules/module-01/pages/TestOfBadFileName.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/documentation-content/bonita/v2021.2/modules/module-01/pages/TestOfBadFileName.adoc b/test/documentation-content/bonita/v2021.2/modules/module-01/pages/TestOfBadFileName.adoc index f2e2ccfb4..e1c4abc2f 100644 --- a/test/documentation-content/bonita/v2021.2/modules/module-01/pages/TestOfBadFileName.adoc +++ b/test/documentation-content/bonita/v2021.2/modules/module-01/pages/TestOfBadFileName.adoc @@ -1,4 +1,5 @@ -= Module 01 += Test of bad file name +:description: Test bad file name description xref:ROOT:old-page-01.adoc[link to ROOT old page 01]. From 581603c7f69a52999ea8467b3fd6a4281e1befa3 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Mon, 7 Oct 2024 09:53:00 +0200 Subject: [PATCH 3/9] use the right branch --- .github/workflows/pr-antora-checker-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-antora-checker-test.yml b/.github/workflows/pr-antora-checker-test.yml index da81cd0c5..4c653dc52 100644 --- a/.github/workflows/pr-antora-checker-test.yml +++ b/.github/workflows/pr-antora-checker-test.yml @@ -12,4 +12,4 @@ jobs: check_antora_content_guidelines: permissions: pull-requests: write # "pr-antora-content-guidelines-checker" write PR comments when the PR doesn't match the "Guidelines" - uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml@master + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml@feat/add_check_on_filename From b1b2197ef547e2c5a6c0451c30dce1a1b67951d3 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Mon, 7 Oct 2024 11:18:07 +0200 Subject: [PATCH 4/9] update pattern --- .github/workflows/pr-antora-checker-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-antora-checker-test.yml b/.github/workflows/pr-antora-checker-test.yml index 4c653dc52..b5b94656a 100644 --- a/.github/workflows/pr-antora-checker-test.yml +++ b/.github/workflows/pr-antora-checker-test.yml @@ -6,7 +6,7 @@ on: paths: - '.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml' - '.github/workflows/pr-antora-checker-test.yml' - - 'test/documentation-content/bonita/v2021.2/**/*' + - 'test/documentation-content/**/*' jobs: check_antora_content_guidelines: From b70d3bdf68b43b3640c0f476386f1b8ae1f95c94 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Tue, 8 Oct 2024 14:01:05 +0200 Subject: [PATCH 5/9] add new input for step-to-skip --- .../_reusable_pr-antora-content-guidelines-checker.yml | 10 +++++++++- .github/workflows/pr-antora-checker-test.yml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml index b20b2edbd..0493bc6f9 100644 --- a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml +++ b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml @@ -8,15 +8,23 @@ name: Check Antora content guidelines in Pull Request on: workflow_call: # this allows the workflow to be reused + inputs: + # Available steps: https://github.com/bonitasoft/actions/blob/main/packages/doc-contribs/pr-antora-content-guidelines-checker/README.md#using-this-action + step-to-skip: + type: string + description: 'Comma-separated list of steps to skip, by default all steps are executed.' + default: '' + required: false jobs: checks: runs-on: ubuntu-22.04 steps: - name: Check - uses: bonitasoft/actions/packages/doc-contribs/pr-antora-content-guidelines-checker@feat/check_file_name + uses: bonitasoft/actions/packages/doc-contribs/pr-antora-content-guidelines-checker@v3 with: attributes-to-check: ':description:' files-to-check: 'adoc' # WARN: Be aware that spaces after/before the coma are not trimmed by the action. This means that the spaces are part of the pattern. forbidden-pattern-to-check: 'https://documentation.bonitasoft.com,link:https,link:http,link:,xref:https,xref:http,xref:_,xref:#,Bonita BPM,https://api-documentation.bonitasoft.com' + step-to-skip: ${{ inputs.step-to-skip }} diff --git a/.github/workflows/pr-antora-checker-test.yml b/.github/workflows/pr-antora-checker-test.yml index b5b94656a..c0bc09568 100644 --- a/.github/workflows/pr-antora-checker-test.yml +++ b/.github/workflows/pr-antora-checker-test.yml @@ -12,4 +12,4 @@ jobs: check_antora_content_guidelines: permissions: pull-requests: write # "pr-antora-content-guidelines-checker" write PR comments when the PR doesn't match the "Guidelines" - uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml@feat/add_check_on_filename + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml@master From 6dea8c58f769d3c8792539add9860c4733bf0547 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Fri, 11 Oct 2024 10:06:17 +0200 Subject: [PATCH 6/9] add comments to avoid bad merge --- .github/workflows/pr-antora-checker-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-antora-checker-test.yml b/.github/workflows/pr-antora-checker-test.yml index c0bc09568..865cb4a02 100644 --- a/.github/workflows/pr-antora-checker-test.yml +++ b/.github/workflows/pr-antora-checker-test.yml @@ -2,6 +2,7 @@ name: Contribution checks on test data on: # use pull_request event to test update done of the reusable workflow (update the branch of the reusable workflow as well in this case) + # TODO: restore pull_request_target before merging this PR pull_request: paths: - '.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml' From 11920b8e3c08559856f0ca225ead6ff754cde478 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Fri, 11 Oct 2024 15:12:44 +0200 Subject: [PATCH 7/9] test the improvement for action --- .../_reusable_pr-antora-content-guidelines-checker.yml | 2 +- .github/workflows/_reusable_pr-comment-list-changes.yml | 2 +- .github/workflows/pr-antora-checker-test.yml | 2 +- .github/workflows/pr-comment-list-changes.yml | 2 +- .../bonita/v2021.1/modules/module-01/nav.adoc | 2 +- .../v2021.1/modules/module-01/pages/{index.adoc => toto.adoc} | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename test/documentation-content/bonita/v2021.1/modules/module-01/pages/{index.adoc => toto.adoc} (100%) diff --git a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml index 0493bc6f9..5a30259ea 100644 --- a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml +++ b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check - uses: bonitasoft/actions/packages/doc-contribs/pr-antora-content-guidelines-checker@v3 + uses: bonitasoft/actions/packages/doc-contribs/pr-antora-content-guidelines-checker@feat/list_renamed_file_from_pr with: attributes-to-check: ':description:' files-to-check: 'adoc' diff --git a/.github/workflows/_reusable_pr-comment-list-changes.yml b/.github/workflows/_reusable_pr-comment-list-changes.yml index 99ef5b428..f5e50e74c 100644 --- a/.github/workflows/_reusable_pr-comment-list-changes.yml +++ b/.github/workflows/_reusable_pr-comment-list-changes.yml @@ -25,7 +25,7 @@ jobs: with: surge-token: ${{ secrets.SURGE_TOKEN_DOC }} - name: Comments PR with links - uses: bonitasoft/actions/packages/doc-contribs/pr-comments-with-links@v3 + uses: bonitasoft/actions/packages/doc-contribs/pr-comments-with-links@feat/list_renamed_file_from_pr with: site-url: ${{ steps.surge-preview-tools.outputs.preview-url }} component-name: ${{ inputs.component-name }} diff --git a/.github/workflows/pr-antora-checker-test.yml b/.github/workflows/pr-antora-checker-test.yml index 865cb4a02..98ce63504 100644 --- a/.github/workflows/pr-antora-checker-test.yml +++ b/.github/workflows/pr-antora-checker-test.yml @@ -13,4 +13,4 @@ jobs: check_antora_content_guidelines: permissions: pull-requests: write # "pr-antora-content-guidelines-checker" write PR comments when the PR doesn't match the "Guidelines" - uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml@master + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml@feat/add_check_on_filename diff --git a/.github/workflows/pr-comment-list-changes.yml b/.github/workflows/pr-comment-list-changes.yml index c2e271f79..d3fdf8488 100644 --- a/.github/workflows/pr-comment-list-changes.yml +++ b/.github/workflows/pr-comment-list-changes.yml @@ -1,7 +1,7 @@ name: Comments PR with changes list on: - pull_request_target: + pull_request: paths: - '.github/workflows/_reusable_pr-comment-list-changes.yml' - '.github/workflows/pr-comment-list-changes.yml' diff --git a/test/documentation-content/bonita/v2021.1/modules/module-01/nav.adoc b/test/documentation-content/bonita/v2021.1/modules/module-01/nav.adoc index eb71b2179..e49512578 100644 --- a/test/documentation-content/bonita/v2021.1/modules/module-01/nav.adoc +++ b/test/documentation-content/bonita/v2021.1/modules/module-01/nav.adoc @@ -1 +1 @@ -** xref:index.adoc[module-01] +** xref:toto.adoc[module-01] diff --git a/test/documentation-content/bonita/v2021.1/modules/module-01/pages/index.adoc b/test/documentation-content/bonita/v2021.1/modules/module-01/pages/toto.adoc similarity index 100% rename from test/documentation-content/bonita/v2021.1/modules/module-01/pages/index.adoc rename to test/documentation-content/bonita/v2021.1/modules/module-01/pages/toto.adoc From e4f53a9ef2a1a05a489e4a6fc95c2ef262d0601f Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Fri, 11 Oct 2024 15:24:27 +0200 Subject: [PATCH 8/9] remove typo on steps to skip input --- .../_reusable_pr-antora-content-guidelines-checker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml index 5a30259ea..e05d90425 100644 --- a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml +++ b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml @@ -10,7 +10,7 @@ on: workflow_call: # this allows the workflow to be reused inputs: # Available steps: https://github.com/bonitasoft/actions/blob/main/packages/doc-contribs/pr-antora-content-guidelines-checker/README.md#using-this-action - step-to-skip: + steps-to-skip: type: string description: 'Comma-separated list of steps to skip, by default all steps are executed.' default: '' @@ -27,4 +27,4 @@ jobs: files-to-check: 'adoc' # WARN: Be aware that spaces after/before the coma are not trimmed by the action. This means that the spaces are part of the pattern. forbidden-pattern-to-check: 'https://documentation.bonitasoft.com,link:https,link:http,link:,xref:https,xref:http,xref:_,xref:#,Bonita BPM,https://api-documentation.bonitasoft.com' - step-to-skip: ${{ inputs.step-to-skip }} + steps-to-skip: ${{ inputs.steps-to-skip }} From 963c5e801bc8ac318a7537fbfbc6ea8272678ac9 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Fri, 11 Oct 2024 15:47:59 +0200 Subject: [PATCH 9/9] use the v3 version --- .../_reusable_pr-antora-content-guidelines-checker.yml | 2 +- .github/workflows/_reusable_pr-comment-list-changes.yml | 2 +- .github/workflows/pr-antora-checker-test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml index e05d90425..3ca15d4d6 100644 --- a/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml +++ b/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check - uses: bonitasoft/actions/packages/doc-contribs/pr-antora-content-guidelines-checker@feat/list_renamed_file_from_pr + uses: bonitasoft/actions/packages/doc-contribs/pr-antora-content-guidelines-checker@v3 with: attributes-to-check: ':description:' files-to-check: 'adoc' diff --git a/.github/workflows/_reusable_pr-comment-list-changes.yml b/.github/workflows/_reusable_pr-comment-list-changes.yml index f5e50e74c..99ef5b428 100644 --- a/.github/workflows/_reusable_pr-comment-list-changes.yml +++ b/.github/workflows/_reusable_pr-comment-list-changes.yml @@ -25,7 +25,7 @@ jobs: with: surge-token: ${{ secrets.SURGE_TOKEN_DOC }} - name: Comments PR with links - uses: bonitasoft/actions/packages/doc-contribs/pr-comments-with-links@feat/list_renamed_file_from_pr + uses: bonitasoft/actions/packages/doc-contribs/pr-comments-with-links@v3 with: site-url: ${{ steps.surge-preview-tools.outputs.preview-url }} component-name: ${{ inputs.component-name }} diff --git a/.github/workflows/pr-antora-checker-test.yml b/.github/workflows/pr-antora-checker-test.yml index 98ce63504..4efb9cc60 100644 --- a/.github/workflows/pr-antora-checker-test.yml +++ b/.github/workflows/pr-antora-checker-test.yml @@ -13,4 +13,4 @@ jobs: check_antora_content_guidelines: permissions: pull-requests: write # "pr-antora-content-guidelines-checker" write PR comments when the PR doesn't match the "Guidelines" - uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml@feat/add_check_on_filename + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-antora-content-guidelines-checker.yml