From 0f8af304b39820c480824e8deb8c2ae577dc0e61 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:29:00 +1000 Subject: [PATCH 01/58] =?UTF-8?q?=F0=9F=94=A7=20add=20markdown=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/validate-markdown.yml | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/validate-markdown.yml diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml new file mode 100644 index 00000000000..48bc844c312 --- /dev/null +++ b/.github/workflows/validate-markdown.yml @@ -0,0 +1,61 @@ +name: Validate-Frontmatter + +on: + pull_request: + branches: [ main ] + + workflow_dispatch: + +jobs: + validate-frontmatter: + runs-on: ubuntu-latest + permissions: + contents: read + issues: write + repository-projects: read + pull-requests: write + + steps: + # Step 1: Check out the source code of the pull request. + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + # Step 2: Set up the Node.js environment. + - uses: actions/setup-node@v3 + + # Step 3: Get the list of changed files in the PR + - name: Get changed files + id: get_changed + if: ${{ github.event_name == 'pull_request' }} + run: | + echo "changed=$(git diff --name-only $(git merge-base origin/main HEAD) HEAD)" | paste -sd "," - >> $GITHUB_ENV + echo "pr_owner=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV + + # Step 4: Lint + Validate Markdown files + - name: Lint Markdown + id: check_markdown + uses: articulate/actions-markdownlint@v1 + + # Step 5: Write workflow job summary if the previous step failed + - name: Add Job Summary + if: failure() + run: | + echo "Hi @$pr_owner," >> $GITHUB_STEP_SUMMARY + echo "${{ steps.check_markdown.outputs.stdout }}" >> $GITHUB_STEP_SUMMARY + + # Step 6: Leave a comment if the validation has failed and if it's not a PR from a fork + - name: Comment on PR + if: failure() && github.event.pull_request.head.repo.fork == false + uses: mshick/add-pr-comment@v2 + with: + message: | + Hi @${{ env.pr_owner }}, + ${{ steps.check_markdown.outputs.stdout }} + Please fix your Markdown files. + repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token-user-login: "github-actions[bot]" + allow-repeats: true \ No newline at end of file From 43427bd17bfa21df792f00d9d2a29f030a24a045 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:31:11 +1000 Subject: [PATCH 02/58] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20name=20of=20ac?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/validate-markdown.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 48bc844c312..cf976d68145 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -1,4 +1,4 @@ -name: Validate-Frontmatter +name: Validate-Markdown on: pull_request: @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - validate-frontmatter: + validate-markdown: runs-on: ubuntu-latest permissions: contents: read From c6414678b7b27d66626c0162a8b36488c7d16dfe Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:32:16 +1000 Subject: [PATCH 03/58] =?UTF-8?q?=F0=9F=92=A5=20issues=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rules/3-steps-to-a-pbi/rule.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index 82536e4e3e1..0b365c77624 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -62,4 +62,14 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! ::: good ![Figure: The important steps in a PBI lifecycle. Print this "SSW 3 Steps to a PBI pdf" and put it on your 'War Room' wall](3StepsToAPBI.jpg) -::: +::: + + +Might get picked up + +# Heading? + +--- +title: test + +---- From 32caa389298a63eb09c2656d4d5b1bc437a034df Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:41:50 +1000 Subject: [PATCH 04/58] test --- .github/workflows/validate-markdown.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index cf976d68145..3ef329af294 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -24,8 +24,8 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - # Step 2: Set up the Node.js environment. - - uses: actions/setup-node@v3 + # # Step 2: Set up the Node.js environment. + # - uses: actions/setup-node@v3 # Step 3: Get the list of changed files in the PR - name: Get changed files @@ -39,6 +39,10 @@ jobs: - name: Lint Markdown id: check_markdown uses: articulate/actions-markdownlint@v1 + with: + # config: markdownlint-config.json + files: ${{ env.changed }} + ignore: node_modules # Step 5: Write workflow job summary if the previous step failed - name: Add Job Summary From 3c8fe631661ed8f223a5bb413f4b6ece6150e006 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:45:47 +1000 Subject: [PATCH 05/58] test --- .github/workflows/validate-markdown.yml | 2 +- .markdownlint/config.json | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .markdownlint/config.json diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 3ef329af294..c1891faa12f 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -40,7 +40,7 @@ jobs: id: check_markdown uses: articulate/actions-markdownlint@v1 with: - # config: markdownlint-config.json + config: ./.markdownlint/config.json files: ${{ env.changed }} ignore: node_modules diff --git a/.markdownlint/config.json b/.markdownlint/config.json new file mode 100644 index 00000000000..9866d8d401b --- /dev/null +++ b/.markdownlint/config.json @@ -0,0 +1,20 @@ +{ + "default": true, + "MD003": { + "style": "atx" + }, + "MD004": { + "style": "asterisk" + }, + "MD013": { + "code_blocks": false, + "tables": false + }, + "MD033": { + "allowed_elements": [ + "details", + "summary" + ] + }, + "MD046": false +} \ No newline at end of file From 94ac68a22601dc96dc95ba5faa701a27ffe04e0a Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:48:09 +1000 Subject: [PATCH 06/58] test --- .github/workflows/validate-markdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index c1891faa12f..183b01526ea 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -41,7 +41,7 @@ jobs: uses: articulate/actions-markdownlint@v1 with: config: ./.markdownlint/config.json - files: ${{ env.changed }} + files: '*.md' ignore: node_modules # Step 5: Write workflow job summary if the previous step failed From cec4ea16a640114e23394fb4ac2f842a3123cf6c Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:51:44 +1000 Subject: [PATCH 07/58] test --- .github/workflows/validate-markdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 183b01526ea..c1891faa12f 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -41,7 +41,7 @@ jobs: uses: articulate/actions-markdownlint@v1 with: config: ./.markdownlint/config.json - files: '*.md' + files: ${{ env.changed }} ignore: node_modules # Step 5: Write workflow job summary if the previous step failed From 0cb5408df7b61a4da48e5170f13db7774423c206 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:59:48 +1000 Subject: [PATCH 08/58] update --- .github/workflows/validate-markdown.yml | 37 +------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index c1891faa12f..478770c9891 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -23,43 +23,8 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - # # Step 2: Set up the Node.js environment. - # - uses: actions/setup-node@v3 - - # Step 3: Get the list of changed files in the PR - - name: Get changed files - id: get_changed - if: ${{ github.event_name == 'pull_request' }} - run: | - echo "changed=$(git diff --name-only $(git merge-base origin/main HEAD) HEAD)" | paste -sd "," - >> $GITHUB_ENV - echo "pr_owner=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV - - # Step 4: Lint + Validate Markdown files - - name: Lint Markdown - id: check_markdown - uses: articulate/actions-markdownlint@v1 + - uses: articulate/actions-markdownlint@v1 with: config: ./.markdownlint/config.json files: ${{ env.changed }} ignore: node_modules - - # Step 5: Write workflow job summary if the previous step failed - - name: Add Job Summary - if: failure() - run: | - echo "Hi @$pr_owner," >> $GITHUB_STEP_SUMMARY - echo "${{ steps.check_markdown.outputs.stdout }}" >> $GITHUB_STEP_SUMMARY - - # Step 6: Leave a comment if the validation has failed and if it's not a PR from a fork - - name: Comment on PR - if: failure() && github.event.pull_request.head.repo.fork == false - uses: mshick/add-pr-comment@v2 - with: - message: | - Hi @${{ env.pr_owner }}, - ${{ steps.check_markdown.outputs.stdout }} - Please fix your Markdown files. - repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: "github-actions[bot]" - allow-repeats: true \ No newline at end of file From cf865e9ac1d934654ada39c439d82abd6b1928ab Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:00:07 +1000 Subject: [PATCH 09/58] test --- .github/workflows/validate-markdown.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 478770c9891..89126fc20ed 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -26,5 +26,3 @@ jobs: - uses: articulate/actions-markdownlint@v1 with: config: ./.markdownlint/config.json - files: ${{ env.changed }} - ignore: node_modules From f030821abc5237b1454c4acf0ca62741269f479a Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:02:58 +1000 Subject: [PATCH 10/58] try default --- .github/workflows/validate-markdown.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 89126fc20ed..1ac399a7c03 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -24,5 +24,3 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - uses: articulate/actions-markdownlint@v1 - with: - config: ./.markdownlint/config.json From de181aca95022a23177f24712d976c6dd446583d Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:05:35 +1000 Subject: [PATCH 11/58] test --- .github/workflows/validate-markdown.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 1ac399a7c03..5cdc435f9d8 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -2,25 +2,28 @@ name: Validate-Markdown on: pull_request: - branches: [ main ] - - workflow_dispatch: + branches: [ main ] # Trigger the workflow on pull requests to main branch + workflow_dispatch: # Allow manual triggering of the workflow jobs: validate-markdown: - runs-on: ubuntu-latest - permissions: + runs-on: ubuntu-latest # The type of runner that the job will run on + permissions: # Permissions for the GITHUB_TOKEN in the workflow contents: read issues: write repository-projects: read pull-requests: write steps: - # Step 1: Check out the source code of the pull request. + # Step 1: Check out the source code of the pull request - uses: actions/checkout@v3 with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - uses: articulate/actions-markdownlint@v1 + fetch-depth: 0 # Fetch all history for all tags and branches + token: ${{ secrets.GITHUB_TOKEN }} # Token to authenticate + ref: ${{ github.event.pull_request.head.ref }} # Reference to the PR head + repository: ${{ github.event.pull_request.head.repo.full_name }} # Repository of the PR head + + # Step 2: Lint Markdown files + - uses: articulate/actions-markdownlint@v1 # Use the markdown linting action + with: + config: ./.markdownlint/config.json # Path to linting rules configuration From 269c4d5db21f46471cea46f2a52fcf6d6dd1dc47 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:07:15 +1000 Subject: [PATCH 12/58] test --- .github/workflows/validate-markdown.yml | 35 ++++++++++++++++--------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 5cdc435f9d8..6ee3a0f0970 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -2,28 +2,39 @@ name: Validate-Markdown on: pull_request: - branches: [ main ] # Trigger the workflow on pull requests to main branch - workflow_dispatch: # Allow manual triggering of the workflow + branches: [ main ] + paths: + - '**.md' # This ensures the workflow only runs if there's a change in any Markdown files + + workflow_dispatch: jobs: validate-markdown: - runs-on: ubuntu-latest # The type of runner that the job will run on - permissions: # Permissions for the GITHUB_TOKEN in the workflow + runs-on: ubuntu-latest + permissions: contents: read issues: write repository-projects: read pull-requests: write steps: - # Step 1: Check out the source code of the pull request - uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history for all tags and branches - token: ${{ secrets.GITHUB_TOKEN }} # Token to authenticate - ref: ${{ github.event.pull_request.head.ref }} # Reference to the PR head - repository: ${{ github.event.pull_request.head.repo.full_name }} # Repository of the PR head + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + # Step to get a list of all the changed Markdown files + - name: Get changed files + id: files + uses: lots0logs/gh-action-get-changed-files@2.1.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} - # Step 2: Lint Markdown files - - uses: articulate/actions-markdownlint@v1 # Use the markdown linting action + # Step to lint only the changed Markdown files + - name: Lint Markdown files + uses: articulate/actions-markdownlint@v1 with: - config: ./.markdownlint/config.json # Path to linting rules configuration + config: ./.markdownlint/config.json + files: ${{ steps.files.outputs.all }} # This passes the list of changed files to the linter From 02b90b0052da017eac751fd0080f9df9e914ffaf Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:11:50 +1000 Subject: [PATCH 13/58] test --- .github/workflows/validate-markdown.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 6ee3a0f0970..b652ae7356f 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -1,13 +1,3 @@ -name: Validate-Markdown - -on: - pull_request: - branches: [ main ] - paths: - - '**.md' # This ensures the workflow only runs if there's a change in any Markdown files - - workflow_dispatch: - jobs: validate-markdown: runs-on: ubuntu-latest @@ -25,16 +15,24 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - # Step to get a list of all the changed Markdown files - name: Get changed files id: files uses: lots0logs/gh-action-get-changed-files@2.1.4 with: token: ${{ secrets.GITHUB_TOKEN }} - # Step to lint only the changed Markdown files + # New step to filter and format the Markdown files + - name: Filter and format Markdown files + id: markdown_files + run: | + # Get a space-separated list of changed markdown files + MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') + # Set the formatted list as an output variable + echo "::set-output name=list::$MARKDOWN_FILES" + - name: Lint Markdown files uses: articulate/actions-markdownlint@v1 with: config: ./.markdownlint/config.json - files: ${{ steps.files.outputs.all }} # This passes the list of changed files to the linter + # Pass the space-separated list of markdown files to the linter + files: ${{ steps.markdown_files.outputs.list }} From d72666ad6f6530571a0a642303436c2a3165fa7f Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:12:33 +1000 Subject: [PATCH 14/58] fix --- .github/workflows/validate-markdown.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index b652ae7356f..561946b2b1e 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -1,3 +1,13 @@ +name: Validate-Markdown + +on: + pull_request: + branches: [ main ] + paths: + - '**.md' # This ensures the workflow only runs if there's a change in any Markdown files + + workflow_dispatch: + jobs: validate-markdown: runs-on: ubuntu-latest @@ -36,3 +46,4 @@ jobs: config: ./.markdownlint/config.json # Pass the space-separated list of markdown files to the linter files: ${{ steps.markdown_files.outputs.list }} + From 3009e4c8eedb754b2bd07a5ed47fee017f69b774 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:17:45 +1000 Subject: [PATCH 15/58] test --- .github/workflows/validate-markdown.yml | 43 ++++++++++++++++++++----- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 561946b2b1e..f0998e0718e 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -31,19 +31,46 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - # New step to filter and format the Markdown files - name: Filter and format Markdown files id: markdown_files run: | - # Get a space-separated list of changed markdown files MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') - # Set the formatted list as an output variable echo "::set-output name=list::$MARKDOWN_FILES" - name: Lint Markdown files - uses: articulate/actions-markdownlint@v1 - with: - config: ./.markdownlint/config.json - # Pass the space-separated list of markdown files to the linter - files: ${{ steps.markdown_files.outputs.list }} + id: lint_markdown + continue-on-error: true + run: | + OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config ./.markdownlint/config.json 2>&1) + echo "::set-output name=markdownlint_output::${OUTPUT}" + echo "${OUTPUT}" + + - name: Create comment body with error links + id: create_comment_body + if: steps.lint_markdown.outcome == 'failure' + run: | + COMMENT_BODY="There are markdown linting issues:\n" + while read -r line; do + if [[ "$line" =~ rules/(.+\.md):([0-9]+):([0-9]+) ]]; then + FILENAME=${BASH_REMATCH[1]} + LINENUMBER=${BASH_REMATCH[2]} + MESSAGE=${line/*MD/MD} + URL="https://github.com/${{ github.repository }}/blob/${{ github.sha }}/${FILENAME}#L${LINENUMBER}" + COMMENT_BODY+="[$FILENAME line $LINENUMBER]($URL): $MESSAGE\n" + fi + done <<< "${{ steps.lint_markdown.outputs.markdownlint_output }}" + echo "::set-output name=comment_body::${COMMENT_BODY}" + - name: Add Job Summary + if: steps.lint_markdown.outcome == 'failure' + run: | + echo "${{ steps.create_comment_body.outputs.comment_body }}" >> $GITHUB_STEP_SUMMARY + + - name: Comment on PR + if: steps.lint_markdown.outcome == 'failure' && github.event.pull_request.head.repo.fork == false + uses: mshick/add-pr-comment@v2 + with: + message: "${{ steps.create_comment_body.outputs.comment_body }}" + repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token-user-login: "github-actions[bot]" + allow-repeats: true From 517f630970447189f1f4014490e6b3861b780ae5 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:21:37 +1000 Subject: [PATCH 16/58] test --- .github/workflows/validate-markdown.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index f0998e0718e..9ca2358f10d 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [ main ] paths: - - '**.md' # This ensures the workflow only runs if there's a change in any Markdown files + - '**.md' # Only run workflow for Markdown file changes workflow_dispatch: @@ -25,6 +25,14 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Install Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install markdownlint-cli + run: npm install -g markdownlint-cli + - name: Get changed files id: files uses: lots0logs/gh-action-get-changed-files@2.1.4 @@ -41,9 +49,11 @@ jobs: id: lint_markdown continue-on-error: true run: | - OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config ./.markdownlint/config.json 2>&1) + OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint.json 2>&1) echo "::set-output name=markdownlint_output::${OUTPUT}" echo "${OUTPUT}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create comment body with error links id: create_comment_body From 9a4309fa2da48c11c1f5f877e5350bb2c2c2a17e Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:23:59 +1000 Subject: [PATCH 17/58] fix config --- .github/workflows/validate-markdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 9ca2358f10d..70c410b8246 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -49,7 +49,7 @@ jobs: id: lint_markdown continue-on-error: true run: | - OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint.json 2>&1) + OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json 2>&1) echo "::set-output name=markdownlint_output::${OUTPUT}" echo "${OUTPUT}" env: From b9987e0416f20658d738292cfcc1737401a67ee2 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:26:00 +1000 Subject: [PATCH 18/58] test --- .github/workflows/validate-markdown.yml | 62 +++---------------------- 1 file changed, 7 insertions(+), 55 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 70c410b8246..b652ae7356f 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -1,13 +1,3 @@ -name: Validate-Markdown - -on: - pull_request: - branches: [ main ] - paths: - - '**.md' # Only run workflow for Markdown file changes - - workflow_dispatch: - jobs: validate-markdown: runs-on: ubuntu-latest @@ -25,62 +15,24 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Install Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Install markdownlint-cli - run: npm install -g markdownlint-cli - - name: Get changed files id: files uses: lots0logs/gh-action-get-changed-files@2.1.4 with: token: ${{ secrets.GITHUB_TOKEN }} + # New step to filter and format the Markdown files - name: Filter and format Markdown files id: markdown_files run: | + # Get a space-separated list of changed markdown files MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') + # Set the formatted list as an output variable echo "::set-output name=list::$MARKDOWN_FILES" - name: Lint Markdown files - id: lint_markdown - continue-on-error: true - run: | - OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json 2>&1) - echo "::set-output name=markdownlint_output::${OUTPUT}" - echo "${OUTPUT}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Create comment body with error links - id: create_comment_body - if: steps.lint_markdown.outcome == 'failure' - run: | - COMMENT_BODY="There are markdown linting issues:\n" - while read -r line; do - if [[ "$line" =~ rules/(.+\.md):([0-9]+):([0-9]+) ]]; then - FILENAME=${BASH_REMATCH[1]} - LINENUMBER=${BASH_REMATCH[2]} - MESSAGE=${line/*MD/MD} - URL="https://github.com/${{ github.repository }}/blob/${{ github.sha }}/${FILENAME}#L${LINENUMBER}" - COMMENT_BODY+="[$FILENAME line $LINENUMBER]($URL): $MESSAGE\n" - fi - done <<< "${{ steps.lint_markdown.outputs.markdownlint_output }}" - echo "::set-output name=comment_body::${COMMENT_BODY}" - - - name: Add Job Summary - if: steps.lint_markdown.outcome == 'failure' - run: | - echo "${{ steps.create_comment_body.outputs.comment_body }}" >> $GITHUB_STEP_SUMMARY - - - name: Comment on PR - if: steps.lint_markdown.outcome == 'failure' && github.event.pull_request.head.repo.fork == false - uses: mshick/add-pr-comment@v2 + uses: articulate/actions-markdownlint@v1 with: - message: "${{ steps.create_comment_body.outputs.comment_body }}" - repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: "github-actions[bot]" - allow-repeats: true + config: ./.markdownlint/config.json + # Pass the space-separated list of markdown files to the linter + files: ${{ steps.markdown_files.outputs.list }} From aa830643200bfe83e668b65ef637e6abd3bb0e2b Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:26:43 +1000 Subject: [PATCH 19/58] test --- .github/workflows/validate-markdown.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index b652ae7356f..faaf6951d74 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -1,3 +1,13 @@ +name: Validate-Markdown + +on: + pull_request: + branches: [ main ] + paths: + - '**.md' # Only run workflow for Markdown file changes + + workflow_dispatch: + jobs: validate-markdown: runs-on: ubuntu-latest @@ -36,3 +46,4 @@ jobs: config: ./.markdownlint/config.json # Pass the space-separated list of markdown files to the linter files: ${{ steps.markdown_files.outputs.list }} + From d2acb3bb142a539f0045f9447948466307a4219e Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:33:24 +1000 Subject: [PATCH 20/58] test --- .github/workflows/validate-markdown.yml | 33 ++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index faaf6951d74..da37859ce15 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -14,8 +14,8 @@ jobs: permissions: contents: read issues: write - repository-projects: read - pull-requests: write + pull_request: write + actions: write steps: - uses: actions/checkout@v3 @@ -31,19 +31,40 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - # New step to filter and format the Markdown files - name: Filter and format Markdown files id: markdown_files run: | - # Get a space-separated list of changed markdown files MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') - # Set the formatted list as an output variable echo "::set-output name=list::$MARKDOWN_FILES" - name: Lint Markdown files + id: lint_markdown uses: articulate/actions-markdownlint@v1 with: config: ./.markdownlint/config.json - # Pass the space-separated list of markdown files to the linter files: ${{ steps.markdown_files.outputs.list }} + continue-on-error: true + # New Step 5: Write workflow job summary if linting fails + - name: Add Job Summary + if: failure() + run: | + echo "Markdown Linting Errors:" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + echo "${{ steps.lint_markdown.outputs.result }}" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + + # New Step 6: Comment on PR with linting errors if it's not from a fork + - name: Comment on PR + if: failure() && github.event.pull_request.head.repo.fork == false + uses: mshick/add-pr-comment@v2 + with: + message: | + Hi @${{ github.event.pull_request.user.login }}, + There were some Markdown Linting Errors in your pull request: + ``` + ${{ steps.lint_markdown.outputs.result }} + ``` + Please review the errors and update your Markdown files accordingly. + repo-token: ${{ secrets.GITHUB_TOKEN }} + allow-repeats: true From a7f8b310e145e80a9cbf71cf64d20016ad4bc8cb Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:36:09 +1000 Subject: [PATCH 21/58] update --- .github/workflows/validate-markdown.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index da37859ce15..6478733c07b 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -14,8 +14,8 @@ jobs: permissions: contents: read issues: write - pull_request: write - actions: write + repository-projects: read + pull-requests: write steps: - uses: actions/checkout@v3 @@ -31,19 +31,21 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + # New step to filter and format the Markdown files - name: Filter and format Markdown files id: markdown_files run: | + # Get a space-separated list of changed markdown files MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') + # Set the formatted list as an output variable echo "::set-output name=list::$MARKDOWN_FILES" - name: Lint Markdown files - id: lint_markdown uses: articulate/actions-markdownlint@v1 with: config: ./.markdownlint/config.json + # Pass the space-separated list of markdown files to the linter files: ${{ steps.markdown_files.outputs.list }} - continue-on-error: true # New Step 5: Write workflow job summary if linting fails - name: Add Job Summary From a72d73f6e18517e6b98e1bfb89197a5264ff8030 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:37:19 +1000 Subject: [PATCH 22/58] add id --- .github/workflows/validate-markdown.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 6478733c07b..cb2d4b00451 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -41,6 +41,7 @@ jobs: echo "::set-output name=list::$MARKDOWN_FILES" - name: Lint Markdown files + id: lint_markdown uses: articulate/actions-markdownlint@v1 with: config: ./.markdownlint/config.json From 6ab5aa83ca5382dbbc92148c2d1478b12a8eb483 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:41:44 +1000 Subject: [PATCH 23/58] test --- .github/workflows/validate-markdown.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index cb2d4b00451..f5d740698c0 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -40,13 +40,16 @@ jobs: # Set the formatted list as an output variable echo "::set-output name=list::$MARKDOWN_FILES" + - name: Install markdownlint-cli + run: npm install -g markdownlint-cli + - name: Lint Markdown files id: lint_markdown - uses: articulate/actions-markdownlint@v1 - with: - config: ./.markdownlint/config.json - # Pass the space-separated list of markdown files to the linter - files: ${{ steps.markdown_files.outputs.list }} + run: | + OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint.json 2>&1) + echo "::set-output name=result::$OUTPUT" + echo "$OUTPUT" + if [[ "$OUTPUT" != "" ]]; then exit 1; fi # New Step 5: Write workflow job summary if linting fails - name: Add Job Summary From 7c2e8916cd57f411228e413894fd4609e24aa50a Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:44:19 +1000 Subject: [PATCH 24/58] test --- .github/workflows/validate-markdown.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index f5d740698c0..67da7ee8660 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -46,10 +46,14 @@ jobs: - name: Lint Markdown files id: lint_markdown run: | - OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint.json 2>&1) + OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json 2>&1) || true echo "::set-output name=result::$OUTPUT" echo "$OUTPUT" - if [[ "$OUTPUT" != "" ]]; then exit 1; fi + if [[ "$OUTPUT" != "" ]]; then + echo "Linting errors found" + echo "$OUTPUT" >> $GITHUB_STEP_SUMMARY + exit 1 + fi # New Step 5: Write workflow job summary if linting fails - name: Add Job Summary From 3e23f174e842e07b2d816ee2f51631790a81b9ff Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:49:25 +1000 Subject: [PATCH 25/58] test 2 --- .github/workflows/validate-markdown.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 67da7ee8660..1848b1768aa 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -66,15 +66,18 @@ jobs: # New Step 6: Comment on PR with linting errors if it's not from a fork - name: Comment on PR + if: failure() && github.event.pull_request.head.repo.fork == false + run: | + LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | while read -r line; do echo "- [ ] $line"; done) + PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nThere were some Markdown Linting Errors in your pull request:\n$LINT_ERRORS\n\nPlease review the errors and update your Markdown files accordingly." + echo "$PR_COMMENT" > pr_comment.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false uses: mshick/add-pr-comment@v2 with: - message: | - Hi @${{ github.event.pull_request.user.login }}, - There were some Markdown Linting Errors in your pull request: - ``` - ${{ steps.lint_markdown.outputs.result }} - ``` - Please review the errors and update your Markdown files accordingly. + path: pr_comment.md repo-token: ${{ secrets.GITHUB_TOKEN }} allow-repeats: true From bb470ebae905249b956ab8d08a36f57b8e819b51 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:55:18 +1000 Subject: [PATCH 26/58] up --- .github/workflows/validate-markdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 1848b1768aa..c36f99c1e3f 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -78,6 +78,6 @@ jobs: if: failure() && github.event.pull_request.head.repo.fork == false uses: mshick/add-pr-comment@v2 with: - path: pr_comment.md + message-path: pr_comment.md repo-token: ${{ secrets.GITHUB_TOKEN }} allow-repeats: true From f6bed3e333a4bbfcd803e10ee32fbe4c0f6cb246 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:59:15 +1000 Subject: [PATCH 27/58] comment --- .github/workflows/validate-markdown.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index c36f99c1e3f..2eb3e8f8c76 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -68,11 +68,13 @@ jobs: - name: Comment on PR if: failure() && github.event.pull_request.head.repo.fork == false run: | - LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | while read -r line; do echo "- [ ] $line"; done) + # Format lint errors as a list of task list items + LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | awk '{print "- [ ] "$0}') PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nThere were some Markdown Linting Errors in your pull request:\n$LINT_ERRORS\n\nPlease review the errors and update your Markdown files accordingly." echo "$PR_COMMENT" > pr_comment.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false From b2ea9b87d4fa501794d8a3abd7262e74e6566b3c Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:01:04 +1000 Subject: [PATCH 28/58] comment 2 --- .github/workflows/validate-markdown.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 2eb3e8f8c76..6e205faf4b8 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -70,11 +70,13 @@ jobs: run: | # Format lint errors as a list of task list items LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | awk '{print "- [ ] "$0}') - PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nThere were some Markdown Linting Errors in your pull request:\n$LINT_ERRORS\n\nPlease review the errors and update your Markdown files accordingly." + # Use printf to format the string with newlines + PR_COMMENT=$(printf "Hi @%s,\n\nThere were some Markdown Linting Errors in your pull request:\n%s\n\nPlease review the errors and update your Markdown files accordingly." "${{ github.event.pull_request.user.login }}" "$LINT_ERRORS") echo "$PR_COMMENT" > pr_comment.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false From 3a7f7f67cde03a1c1967d40c868a6c98769018a0 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:04:30 +1000 Subject: [PATCH 29/58] test --- .github/workflows/validate-markdown.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 6e205faf4b8..f157f27419c 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -68,15 +68,16 @@ jobs: - name: Comment on PR if: failure() && github.event.pull_request.head.repo.fork == false run: | - # Format lint errors as a list of task list items - LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | awk '{print "- [ ] "$0}') - # Use printf to format the string with newlines - PR_COMMENT=$(printf "Hi @%s,\n\nThere were some Markdown Linting Errors in your pull request:\n%s\n\nPlease review the errors and update your Markdown files accordingly." "${{ github.event.pull_request.user.login }}" "$LINT_ERRORS") + # Convert linting results into a list, prefixing each line with markdown list syntax + LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | sed 's/^/- [ ] /') + # Use printf to handle newlines correctly + PR_COMMENT=$(printf "Hi @%s,\n\nThere were some Markdown Linting Errors in your pull request:\n%s\n\nPlease review the errors and update your Markdown files accordingly.\n" "${{ github.event.pull_request.user.login }}" "$LINT_ERRORS") echo "$PR_COMMENT" > pr_comment.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false From 0356bb8195fb9bea8f56d6d802c8e20dfb814aa4 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:07:17 +1000 Subject: [PATCH 30/58] test --- .github/workflows/validate-markdown.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index f157f27419c..905e1f28ba4 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -64,20 +64,22 @@ jobs: echo "${{ steps.lint_markdown.outputs.result }}" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + - name: Show PR comment content + if: failure() && github.event.pull_request.head.repo.fork == false + run: cat pr_comment.md + # New Step 6: Comment on PR with linting errors if it's not from a fork - name: Comment on PR if: failure() && github.event.pull_request.head.repo.fork == false run: | # Convert linting results into a list, prefixing each line with markdown list syntax - LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | sed 's/^/- [ ] /') + LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | awk '{print "- [ ] " $0}') # Use printf to handle newlines correctly - PR_COMMENT=$(printf "Hi @%s,\n\nThere were some Markdown Linting Errors in your pull request:\n%s\n\nPlease review the errors and update your Markdown files accordingly.\n" "${{ github.event.pull_request.user.login }}" "$LINT_ERRORS") + PR_COMMENT=$(printf "Hi @%s,\n\nThere were some Markdown Linting Errors in your pull request:\n\n%s\n\nPlease review the errors and update your Markdown files accordingly.\n" "${{ github.event.pull_request.user.login }}" "$LINT_ERRORS") echo "$PR_COMMENT" > pr_comment.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false From a77393b41e95cf5f41e5ab532a605e010be545e7 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:08:46 +1000 Subject: [PATCH 31/58] fix --- .github/workflows/validate-markdown.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 905e1f28ba4..2b9ca3702c9 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -64,10 +64,6 @@ jobs: echo "${{ steps.lint_markdown.outputs.result }}" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - - name: Show PR comment content - if: failure() && github.event.pull_request.head.repo.fork == false - run: cat pr_comment.md - # New Step 6: Comment on PR with linting errors if it's not from a fork - name: Comment on PR if: failure() && github.event.pull_request.head.repo.fork == false @@ -80,6 +76,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Show PR comment content + if: failure() && github.event.pull_request.head.repo.fork == false + run: cat pr_comment.md - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false From d5fa4c09036c1046805e8a3e6b0c4611e7918503 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:10:21 +1000 Subject: [PATCH 32/58] test --- .github/workflows/validate-markdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 2b9ca3702c9..2fc6e4d25b3 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -76,7 +76,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Show PR comment content + - name: Show PR comment content if: failure() && github.event.pull_request.head.repo.fork == false run: cat pr_comment.md From f44ebaf9b7aae34d2d584f03b9bdd97f9fdae398 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:13:27 +1000 Subject: [PATCH 33/58] test --- .github/workflows/validate-markdown.yml | 26 +++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 2fc6e4d25b3..56e3018427d 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -46,12 +46,10 @@ jobs: - name: Lint Markdown files id: lint_markdown run: | - OUTPUT=$(markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json 2>&1) || true - echo "::set-output name=result::$OUTPUT" - echo "$OUTPUT" - if [[ "$OUTPUT" != "" ]]; then + markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json > lint-results.txt 2>&1 || true + if [[ -s lint-results.txt ]]; then echo "Linting errors found" - echo "$OUTPUT" >> $GITHUB_STEP_SUMMARY + cat lint-results.txt exit 1 fi @@ -68,11 +66,19 @@ jobs: - name: Comment on PR if: failure() && github.event.pull_request.head.repo.fork == false run: | - # Convert linting results into a list, prefixing each line with markdown list syntax - LINT_ERRORS=$(echo "${{ steps.lint_markdown.outputs.result }}" | awk '{print "- [ ] " $0}') - # Use printf to handle newlines correctly - PR_COMMENT=$(printf "Hi @%s,\n\nThere were some Markdown Linting Errors in your pull request:\n\n%s\n\nPlease review the errors and update your Markdown files accordingly.\n" "${{ github.event.pull_request.user.login }}" "$LINT_ERRORS") - echo "$PR_COMMENT" > pr_comment.md + REPO_URL="https://github.com/${{ github.repository }}/blob/${{ github.sha }}" + RULES_DOCS_URL="https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md" + PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nThere were some Markdown Linting Errors in your pull request:\n\n" + while IFS= read -r line; do + # Extract file path and rule ID from the line + FILE_PATH=$(echo "$line" | awk '{print $1}') + RULE_ID=$(echo "$line" | grep -o 'MD[0-9]\+') + # Append formatted error line to PR comment + PR_COMMENT+="- [ ] [${FILE_PATH}](${REPO_URL}/${FILE_PATH}) ${line} ([Rule ${RULE_ID}](${RULES_DOCS_URL}#${RULE_ID}))\n" + done < lint-results.txt + PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" + # Write the comment to a file + echo -e "$PR_COMMENT" > pr_comment.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f99f63bfbd1f0e4729a1434ff5af20f75a7efd0e Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:33:04 +1000 Subject: [PATCH 34/58] suggestions --- .github/workflows/validate-markdown.yml | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 56e3018427d..94b9515a3d9 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -93,3 +93,44 @@ jobs: message-path: pr_comment.md repo-token: ${{ secrets.GITHUB_TOKEN }} allow-repeats: true + + - name: Auto-fix Markdown files + id: autofix_markdown + run: | + markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true + echo "Auto-fix applied" + + - name: Create diff for suggestions + id: create_diff + run: | + # Assuming ${{ steps.markdown_files.outputs.list }} contains the list of Markdown files + DIFF_OUTPUT="" + for FILE in ${{ steps.markdown_files.outputs.list }}; do + # Create a git diff for the fixed file + DIFF=$(git diff --no-index -- "$FILE" "$FILE.bak") || true + if [ -n "$DIFF" ]; then + # Prepare the suggestion format + DIFF_OUTPUT+="### Suggested changes for \`${FILE}\`:\n" + DIFF_OUTPUT+="\`\`\`suggestion\n" + DIFF_OUTPUT+="$(echo "$DIFF" | tail -n +5)" # Tail is used to skip the diff header + DIFF_OUTPUT+="\`\`\`\n\n" + fi + done + # Set the diff output as a step output + echo "::set-output name=suggestions::$DIFF_OUTPUT" + + - name: Comment suggestions on PR + if: failure() && github.event.pull_request.head.repo.fork == false + run: | + PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nHere are some suggested fixes based on the markdownlint auto-fix:\n\n${{ steps.create_diff.outputs.suggestions }}" + echo "$PR_COMMENT" > pr_suggestions.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload PR Suggestions Comment + if: failure() && github.event.pull_request.head.repo.fork == false + uses: mshick/add-pr-comment@v2 + with: + message-path: pr_suggestions.md + repo-token: ${{ secrets.GITHUB_TOKEN }} + allow-repeats: true From 43bdd58de67a7c696dfb412f877baec423b9ccb7 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:42:14 +1000 Subject: [PATCH 35/58] suggestions 2 --- .github/workflows/validate-markdown.yml | 125 ++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 94b9515a3d9..7d1af06d7a1 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -1,5 +1,50 @@ name: Validate-Markdown +on: + pull_request: + branches: [ main ] + paths: + - '**.md' # Only run workflow for Markdown file changes + + workflow_dispatch: + +jobs: + validate-markdown: + runs-on: ubuntu-latest + permissions: + contents: read + issues: write + repository-projects: read + pull-requests: write + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: Get changed files + id: files + uses: lots0logs/gh-action-get-changed-files@2.1.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + # New step to filter and format the Markdown files + - name: Filter and format Markdown files + id: markdown_files + run: | + # Get a space-separated list of changed markdown files + MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') + # Set the formatted list as an output variable + echo "::set-output name=list::$MARKDOWN_FILES" + + - name: Install markdownlint-cli + run: npm install -g markdownlint-cli + + name: Validate-Markdown + on: pull_request: branches: [ main ] @@ -53,6 +98,86 @@ jobs: exit 1 fi + # New Step 5: Write workflow job summary if linting fails + - name: Add Job Summary + if: failure() + run: | + echo "Markdown Linting Errors:" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + echo "${{ steps.lint_markdown.outputs.result }}" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + + # New Step 6: Comment on PR with linting errors if it's not from a fork + - name: Comment on PR + if: failure() && github.event.pull_request.head.repo.fork == false + run: | + REPO_URL="https://github.com/${{ github.repository }}/blob/${{ github.sha }}" + RULES_DOCS_URL="https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md" + PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nThere were some Markdown Linting Errors in your pull request:\n\n" + while IFS= read -r line; do + # Extract file path and rule ID from the line + FILE_PATH=$(echo "$line" | awk '{print $1}') + RULE_ID=$(echo "$line" | grep -o 'MD[0-9]\+') + # Append formatted error line to PR comment + PR_COMMENT+="- [ ] [${FILE_PATH}](${REPO_URL}/${FILE_PATH}) ${line} ([Rule ${RULE_ID}](${RULES_DOCS_URL}#${RULE_ID}))\n" + done < lint-results.txt + PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" + # Write the comment to a file + echo -e "$PR_COMMENT" > pr_comment.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Show PR comment content + if: failure() && github.event.pull_request.head.repo.fork == false + run: cat pr_comment.md + + - name: Upload PR Comment + if: failure() && github.event.pull_request.head.repo.fork == false + uses: mshick/add-pr-comment@v2 + with: + message-path: pr_comment.md + repo-token: ${{ secrets.GITHUB_TOKEN }} + allow-repeats: true + + - name: Auto-fix Markdown files + if: always() + run: | + markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true + echo "Auto-fix applied" + + - name: Create diff for suggestions + if: always() && steps.lint_markdown.outputs.result != '' + run: | + DIFF_OUTPUT="" + for FILE in ${{ steps.markdown_files.outputs.list }}; do + # Make sure you have the correct paths for the original and backup files + DIFF=$(git diff --no-index -- "${FILE}.bak" "$FILE") || true + if [ -n "$DIFF" ]; then + DIFF_OUTPUT+="### Suggested changes for \`${FILE}\`:\n" + DIFF_OUTPUT+="\`\`\`suggestion\n" + DIFF_OUTPUT+="$(echo "$DIFF" | tail -n +5)" + DIFF_OUTPUT+="\`\`\`\n\n" + fi + done + echo "::set-output name=suggestions::$DIFF_OUTPUT" + + - name: Comment suggestions on PR + if: failure() && github.event.pull_request.head.repo.fork == false + run: | + PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nHere are some suggested fixes based on the markdownlint auto-fix:\n\n${{ steps.create_diff.outputs.suggestions }}" + echo "$PR_COMMENT" > pr_suggestions.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload PR Suggestions Comment + if: failure() && github.event.pull_request.head.repo.fork == false + uses: mshick/add-pr-comment@v2 + with: + message-path: pr_suggestions.md + repo-token: ${{ secrets.GITHUB_TOKEN }} + allow-repeats: true + + # New Step 5: Write workflow job summary if linting fails - name: Add Job Summary if: failure() From 137c5b9e887c7d2ac2ecabfe61a8b489ea68a527 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:53:03 +1000 Subject: [PATCH 36/58] test --- .github/workflows/validate-markdown.yml | 45 ------------------------- 1 file changed, 45 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 7d1af06d7a1..464938f3f60 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -1,50 +1,5 @@ name: Validate-Markdown -on: - pull_request: - branches: [ main ] - paths: - - '**.md' # Only run workflow for Markdown file changes - - workflow_dispatch: - -jobs: - validate-markdown: - runs-on: ubuntu-latest - permissions: - contents: read - issues: write - repository-projects: read - pull-requests: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - - name: Get changed files - id: files - uses: lots0logs/gh-action-get-changed-files@2.1.4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - # New step to filter and format the Markdown files - - name: Filter and format Markdown files - id: markdown_files - run: | - # Get a space-separated list of changed markdown files - MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') - # Set the formatted list as an output variable - echo "::set-output name=list::$MARKDOWN_FILES" - - - name: Install markdownlint-cli - run: npm install -g markdownlint-cli - - name: Validate-Markdown - on: pull_request: branches: [ main ] From c8f36987683a46343d8e1ea94bd83bb56d1d1e46 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:58:16 +1000 Subject: [PATCH 37/58] test --- .github/workflows/validate-markdown.yml | 148 ++---------------------- 1 file changed, 9 insertions(+), 139 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 464938f3f60..d0853f9668a 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [ main ] paths: - - '**.md' # Only run workflow for Markdown file changes + - '**.md' workflow_dispatch: @@ -31,13 +31,10 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - # New step to filter and format the Markdown files - name: Filter and format Markdown files id: markdown_files run: | - # Get a space-separated list of changed markdown files MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') - # Set the formatted list as an output variable echo "::set-output name=list::$MARKDOWN_FILES" - name: Install markdownlint-cli @@ -50,122 +47,28 @@ jobs: if [[ -s lint-results.txt ]]; then echo "Linting errors found" cat lint-results.txt + echo "::set-output name=result::$(cat lint-results.txt)" exit 1 fi - # New Step 5: Write workflow job summary if linting fails - - name: Add Job Summary + - name: Add Job Summary if linting fails if: failure() run: | echo "Markdown Linting Errors:" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - echo "${{ steps.lint_markdown.outputs.result }}" >> $GITHUB_STEP_SUMMARY + cat lint-results.txt >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - # New Step 6: Comment on PR with linting errors if it's not from a fork - - name: Comment on PR + - name: Comment on PR with linting errors if: failure() && github.event.pull_request.head.repo.fork == false run: | - REPO_URL="https://github.com/${{ github.repository }}/blob/${{ github.sha }}" - RULES_DOCS_URL="https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md" PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nThere were some Markdown Linting Errors in your pull request:\n\n" - while IFS= read -r line; do - # Extract file path and rule ID from the line - FILE_PATH=$(echo "$line" | awk '{print $1}') - RULE_ID=$(echo "$line" | grep -o 'MD[0-9]\+') - # Append formatted error line to PR comment - PR_COMMENT+="- [ ] [${FILE_PATH}](${REPO_URL}/${FILE_PATH}) ${line} ([Rule ${RULE_ID}](${RULES_DOCS_URL}#${RULE_ID}))\n" - done < lint-results.txt + PR_COMMENT+=$(awk 'BEGIN {FS=":"; ORS=""} {print "- [ ] [", $1, "](", $1, ") ", $2, "\n"}' lint-results.txt) PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" - # Write the comment to a file - echo -e "$PR_COMMENT" > pr_comment.md + echo "$PR_COMMENT" > pr_comment.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Show PR comment content - if: failure() && github.event.pull_request.head.repo.fork == false - run: cat pr_comment.md - - - name: Upload PR Comment - if: failure() && github.event.pull_request.head.repo.fork == false - uses: mshick/add-pr-comment@v2 - with: - message-path: pr_comment.md - repo-token: ${{ secrets.GITHUB_TOKEN }} - allow-repeats: true - - - name: Auto-fix Markdown files - if: always() - run: | - markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true - echo "Auto-fix applied" - - - name: Create diff for suggestions - if: always() && steps.lint_markdown.outputs.result != '' - run: | - DIFF_OUTPUT="" - for FILE in ${{ steps.markdown_files.outputs.list }}; do - # Make sure you have the correct paths for the original and backup files - DIFF=$(git diff --no-index -- "${FILE}.bak" "$FILE") || true - if [ -n "$DIFF" ]; then - DIFF_OUTPUT+="### Suggested changes for \`${FILE}\`:\n" - DIFF_OUTPUT+="\`\`\`suggestion\n" - DIFF_OUTPUT+="$(echo "$DIFF" | tail -n +5)" - DIFF_OUTPUT+="\`\`\`\n\n" - fi - done - echo "::set-output name=suggestions::$DIFF_OUTPUT" - - - name: Comment suggestions on PR - if: failure() && github.event.pull_request.head.repo.fork == false - run: | - PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nHere are some suggested fixes based on the markdownlint auto-fix:\n\n${{ steps.create_diff.outputs.suggestions }}" - echo "$PR_COMMENT" > pr_suggestions.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload PR Suggestions Comment - if: failure() && github.event.pull_request.head.repo.fork == false - uses: mshick/add-pr-comment@v2 - with: - message-path: pr_suggestions.md - repo-token: ${{ secrets.GITHUB_TOKEN }} - allow-repeats: true - - - # New Step 5: Write workflow job summary if linting fails - - name: Add Job Summary - if: failure() - run: | - echo "Markdown Linting Errors:" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - echo "${{ steps.lint_markdown.outputs.result }}" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - - # New Step 6: Comment on PR with linting errors if it's not from a fork - - name: Comment on PR - if: failure() && github.event.pull_request.head.repo.fork == false - run: | - REPO_URL="https://github.com/${{ github.repository }}/blob/${{ github.sha }}" - RULES_DOCS_URL="https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md" - PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nThere were some Markdown Linting Errors in your pull request:\n\n" - while IFS= read -r line; do - # Extract file path and rule ID from the line - FILE_PATH=$(echo "$line" | awk '{print $1}') - RULE_ID=$(echo "$line" | grep -o 'MD[0-9]\+') - # Append formatted error line to PR comment - PR_COMMENT+="- [ ] [${FILE_PATH}](${REPO_URL}/${FILE_PATH}) ${line} ([Rule ${RULE_ID}](${RULES_DOCS_URL}#${RULE_ID}))\n" - done < lint-results.txt - PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" - # Write the comment to a file - echo -e "$PR_COMMENT" > pr_comment.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Show PR comment content - if: failure() && github.event.pull_request.head.repo.fork == false - run: cat pr_comment.md - - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false uses: mshick/add-pr-comment@v2 @@ -175,42 +78,9 @@ jobs: allow-repeats: true - name: Auto-fix Markdown files - id: autofix_markdown run: | markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true echo "Auto-fix applied" - - name: Create diff for suggestions - id: create_diff - run: | - # Assuming ${{ steps.markdown_files.outputs.list }} contains the list of Markdown files - DIFF_OUTPUT="" - for FILE in ${{ steps.markdown_files.outputs.list }}; do - # Create a git diff for the fixed file - DIFF=$(git diff --no-index -- "$FILE" "$FILE.bak") || true - if [ -n "$DIFF" ]; then - # Prepare the suggestion format - DIFF_OUTPUT+="### Suggested changes for \`${FILE}\`:\n" - DIFF_OUTPUT+="\`\`\`suggestion\n" - DIFF_OUTPUT+="$(echo "$DIFF" | tail -n +5)" # Tail is used to skip the diff header - DIFF_OUTPUT+="\`\`\`\n\n" - fi - done - # Set the diff output as a step output - echo "::set-output name=suggestions::$DIFF_OUTPUT" - - - name: Comment suggestions on PR - if: failure() && github.event.pull_request.head.repo.fork == false - run: | - PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nHere are some suggested fixes based on the markdownlint auto-fix:\n\n${{ steps.create_diff.outputs.suggestions }}" - echo "$PR_COMMENT" > pr_suggestions.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload PR Suggestions Comment - if: failure() && github.event.pull_request.head.repo.fork == false - uses: mshick/add-pr-comment@v2 - with: - message-path: pr_suggestions.md - repo-token: ${{ secrets.GITHUB_TOKEN }} - allow-repeats: true + # Note: Removed the diff creation and suggestion comments. + # You need to decide how you want to handle the suggestions after auto-fix. From ab9e8bb4b91b2f4840ec51fd212dce217ad5caf1 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:07:37 +1000 Subject: [PATCH 38/58] change order --- .github/workflows/validate-markdown.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index d0853f9668a..0cf4d44f96e 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -51,19 +51,17 @@ jobs: exit 1 fi - - name: Add Job Summary if linting fails - if: failure() - run: | - echo "Markdown Linting Errors:" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - cat lint-results.txt >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - - name: Comment on PR with linting errors if: failure() && github.event.pull_request.head.repo.fork == false run: | - PR_COMMENT="Hi @${{ github.event.pull_request.user.login }},\n\nThere were some Markdown Linting Errors in your pull request:\n\n" - PR_COMMENT+=$(awk 'BEGIN {FS=":"; ORS=""} {print "- [ ] [", $1, "](", $1, ") ", $2, "\n"}' lint-results.txt) + RULES_DOCS_URL="https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md" + PR_COMMENT="Hi @JackDevAU,\n\nThere were some Markdown Linting Errors in your pull request:\n\n" + while IFS= read -r line; do + FILE_PATH=$(echo "$line" | awk -F: '{print $1}') + LINE_NUM=$(echo "$line" | awk -F: '{print $2}') + RULE_ID=$(echo "$line" | grep -o 'MD[0-9]\+') + PR_COMMENT+="$FILE_PATH | Line: $LINE_NUM | [Rule $RULE_ID]($RULES_DOCS_URL#$RULE_ID)\n" + done < lint-results.txt PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" echo "$PR_COMMENT" > pr_comment.md env: @@ -81,6 +79,3 @@ jobs: run: | markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true echo "Auto-fix applied" - - # Note: Removed the diff creation and suggestion comments. - # You need to decide how you want to handle the suggestions after auto-fix. From 3fe8e3ef765d44064e6b3a47aa404b8bb28e5968 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:11:25 +1000 Subject: [PATCH 39/58] reorder --- .github/workflows/validate-markdown.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 0cf4d44f96e..47be6b19a37 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -40,6 +40,11 @@ jobs: - name: Install markdownlint-cli run: npm install -g markdownlint-cli + - name: Auto-fix Markdown files + run: | + markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true + echo "Auto-fix applied" + - name: Lint Markdown files id: lint_markdown run: | @@ -74,8 +79,3 @@ jobs: message-path: pr_comment.md repo-token: ${{ secrets.GITHUB_TOKEN }} allow-repeats: true - - - name: Auto-fix Markdown files - run: | - markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true - echo "Auto-fix applied" From 7ab134a5cc3986a78ac9227ae2df62f9a6395737 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:13:33 +1000 Subject: [PATCH 40/58] fix comment --- .github/workflows/validate-markdown.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 47be6b19a37..32f6fa127cf 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -68,10 +68,11 @@ jobs: PR_COMMENT+="$FILE_PATH | Line: $LINE_NUM | [Rule $RULE_ID]($RULES_DOCS_URL#$RULE_ID)\n" done < lint-results.txt PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" - echo "$PR_COMMENT" > pr_comment.md + echo -e "$PR_COMMENT" > pr_comment.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false uses: mshick/add-pr-comment@v2 From a697b2236bede8a255a05b0785585b5f1ef5a10d Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:21:21 +1000 Subject: [PATCH 41/58] Add Markdown linting error details to pull request comment. --- .github/workflows/validate-markdown.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 32f6fa127cf..ca1f4d363cf 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -61,11 +61,14 @@ jobs: run: | RULES_DOCS_URL="https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md" PR_COMMENT="Hi @JackDevAU,\n\nThere were some Markdown Linting Errors in your pull request:\n\n" + PR_COMMENT+="| File | Line | Error | Rule |\n" + PR_COMMENT+="| ---- | ---- | ----- | ---- |\n" while IFS= read -r line; do FILE_PATH=$(echo "$line" | awk -F: '{print $1}') LINE_NUM=$(echo "$line" | awk -F: '{print $2}') + ERROR=$(echo "$line" | cut -d' ' -f 4-) RULE_ID=$(echo "$line" | grep -o 'MD[0-9]\+') - PR_COMMENT+="$FILE_PATH | Line: $LINE_NUM | [Rule $RULE_ID]($RULES_DOCS_URL#$RULE_ID)\n" + PR_COMMENT+="| $FILE_PATH | $LINE_NUM | $ERROR | [Rule $RULE_ID]($RULES_DOCS_URL#$RULE_ID) |\n" done < lint-results.txt PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" echo -e "$PR_COMMENT" > pr_comment.md From 51994ac1f617f7ce5a471fa1d6ae57c77e45d52e Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:35:25 +1000 Subject: [PATCH 42/58] Apply auto-fix for Markdown files and disable MD013 rule --- .github/workflows/validate-markdown.yml | 8 +++++++- .markdownlint/config.json | 7 ++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index ca1f4d363cf..33563db5f95 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -43,7 +43,14 @@ jobs: - name: Auto-fix Markdown files run: | markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add . + git commit -m "Auto-fix Markdown files" || true # Commit only if there are changes + git push || true # Push only if there was a commit echo "Auto-fix applied" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Lint Markdown files id: lint_markdown @@ -75,7 +82,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false uses: mshick/add-pr-comment@v2 diff --git a/.markdownlint/config.json b/.markdownlint/config.json index 9866d8d401b..e1cb8d656f1 100644 --- a/.markdownlint/config.json +++ b/.markdownlint/config.json @@ -6,15 +6,12 @@ "MD004": { "style": "asterisk" }, - "MD013": { - "code_blocks": false, - "tables": false - }, "MD033": { "allowed_elements": [ "details", "summary" ] }, - "MD046": false + "MD046": false, + "MD013": false } \ No newline at end of file From 7c9b1e612710c53afee28b597abfbaf299bed85b Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:49:13 +1000 Subject: [PATCH 43/58] test fixes --- .github/workflows/validate-markdown.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 33563db5f95..ab1a48eed42 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -67,15 +67,17 @@ jobs: if: failure() && github.event.pull_request.head.repo.fork == false run: | RULES_DOCS_URL="https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md" + PR_BASE_URI="https://github.com/${{ github.event.pull_request.head.repo.full_name }}/pull/${{ github.event.pull_request.number }}/files" PR_COMMENT="Hi @JackDevAU,\n\nThere were some Markdown Linting Errors in your pull request:\n\n" - PR_COMMENT+="| File | Line | Error | Rule |\n" - PR_COMMENT+="| ---- | ---- | ----- | ---- |\n" + PR_COMMENT+="| File | Error | Rule |\n" + PR_COMMENT+="| ---- | ----- | ---- |\n" while IFS= read -r line; do FILE_PATH=$(echo "$line" | awk -F: '{print $1}') LINE_NUM=$(echo "$line" | awk -F: '{print $2}') - ERROR=$(echo "$line" | cut -d' ' -f 4-) + ERROR=$(echo "$line" | awk -F: 'sub(/MD[0-9]+.*/, "", $0)' | xargs) RULE_ID=$(echo "$line" | grep -o 'MD[0-9]\+') - PR_COMMENT+="| $FILE_PATH | $LINE_NUM | $ERROR | [Rule $RULE_ID]($RULES_DOCS_URL#$RULE_ID) |\n" + FILE_LINK="${PR_BASE_URI}#diff-$(echo "$FILE_PATH" | md5sum | awk '{print $1}')" + PR_COMMENT+="| [$FILE_PATH]($FILE_LINK) | $ERROR | [Rule $RULE_ID]($RULES_DOCS_URL#$RULE_ID) |\n" done < lint-results.txt PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" echo -e "$PR_COMMENT" > pr_comment.md From e58dd4abf52afe809666e6aaae9b8aea41aeaecf Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:55:17 +1000 Subject: [PATCH 44/58] Fix permissions in validate-markdown workflow --- .github/workflows/validate-markdown.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index ab1a48eed42..31d12f10579 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -12,7 +12,7 @@ jobs: validate-markdown: runs-on: ubuntu-latest permissions: - contents: read + contents: write issues: write repository-projects: read pull-requests: write @@ -67,23 +67,26 @@ jobs: if: failure() && github.event.pull_request.head.repo.fork == false run: | RULES_DOCS_URL="https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md" - PR_BASE_URI="https://github.com/${{ github.event.pull_request.head.repo.full_name }}/pull/${{ github.event.pull_request.number }}/files" + PR_NUMBER="${{ github.event.pull_request.number }}" + REPO_FULL_NAME="${{ github.repository }}" PR_COMMENT="Hi @JackDevAU,\n\nThere were some Markdown Linting Errors in your pull request:\n\n" PR_COMMENT+="| File | Error | Rule |\n" PR_COMMENT+="| ---- | ----- | ---- |\n" while IFS= read -r line; do FILE_PATH=$(echo "$line" | awk -F: '{print $1}') LINE_NUM=$(echo "$line" | awk -F: '{print $2}') - ERROR=$(echo "$line" | awk -F: 'sub(/MD[0-9]+.*/, "", $0)' | xargs) + ERROR_DESC=$(echo "$line" | cut -d' ' -f 4- | sed 's/\[.*\]//') # Remove the markdown link from the description RULE_ID=$(echo "$line" | grep -o 'MD[0-9]\+') - FILE_LINK="${PR_BASE_URI}#diff-$(echo "$FILE_PATH" | md5sum | awk '{print $1}')" - PR_COMMENT+="| [$FILE_PATH]($FILE_LINK) | $ERROR | [Rule $RULE_ID]($RULES_DOCS_URL#$RULE_ID) |\n" + FILE_NAME=$(basename "$FILE_PATH") + FILE_ANCHOR=$(echo "$FILE_NAME" | sed 's/\./-/g') + PR_COMMENT+="| [$FILE_PATH](https://github.com/$REPO_FULL_NAME/pull/$PR_NUMBER/files#$FILE_ANCHOR) | Line $LINE_NUM: $ERROR_DESC | [Rule $RULE_ID]($RULES_DOCS_URL#$RULE_ID) |\n" done < lint-results.txt PR_COMMENT+="\nPlease review the errors and update your Markdown files accordingly.\n" echo -e "$PR_COMMENT" > pr_comment.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false uses: mshick/add-pr-comment@v2 From 61199d04bb8e408c19fe81788ea66ebc62aeafef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 Nov 2023 07:56:14 +0000 Subject: [PATCH 45/58] Auto-fix Markdown files --- rules/3-steps-to-a-pbi/rule.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index 0b365c77624..d09198aa21d 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -19,7 +19,7 @@ guid: 1de9df77-9b69-4242-b648-e08e5980e9a6 --- -A PBI (Product Backlog Item) is a term commonly used in Agile project management and software development to represent a unit of work or an item in the Product Backlog, which is a prioritized list of features, enhancements, or fixes to be addressed in a project. +A PBI (Product Backlog Item) is a term commonly used in Agile project management and software development to represent a unit of work or an item in the Product Backlog, which is a prioritized list of features, enhancements, or fixes to be addressed in a project. From a developer's viewpoint, the lifecycle of a PBI can be broken down into 3 steps: @@ -62,14 +62,13 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! ::: good ![Figure: The important steps in a PBI lifecycle. Print this "SSW 3 Steps to a PBI pdf" and put it on your 'War Room' wall](3StepsToAPBI.jpg) -::: +::: +Might get picked up -Might get picked up +# Heading? -# Heading? - ---- +--- title: test ----- +---- From c65b3e55352da585d2fc4713cffbae201082d5a6 Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:59:41 +1000 Subject: [PATCH 46/58] Remove unnecessary lines in rule.md --- rules/3-steps-to-a-pbi/rule.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index d09198aa21d..856b028e0cb 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -66,9 +66,6 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! Might get picked up -# Heading? - --- title: test - ----- +--- From c80ca183a56b8181f35f2341bf716dfafe84e12e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 Nov 2023 08:00:36 +0000 Subject: [PATCH 47/58] Auto-fix Markdown files --- rules/3-steps-to-a-pbi/rule.md | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index 856b028e0cb..847d47ec329 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -67,5 +67,6 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! Might get picked up --- + title: test --- From 58f22a6d92670f5846aade5801283d479b451dbd Mon Sep 17 00:00:00 2001 From: "Jack Pettit [SSW]" <57518417+JackDevAU@users.noreply.github.com> Date: Wed, 8 Nov 2023 18:01:15 +1000 Subject: [PATCH 48/58] Add title to PBI rule.md --- rules/3-steps-to-a-pbi/rule.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index 856b028e0cb..d6ae198794f 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -67,5 +67,7 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! Might get picked up --- + title: test + --- From f02a602eea216e0ea823e8beb887e939c47e2ba6 Mon Sep 17 00:00:00 2001 From: jackcsepettit Date: Thu, 9 Nov 2023 04:05:51 +0000 Subject: [PATCH 49/58] test --- .github/workflows/validate-markdown.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/validate-markdown.yml b/.github/workflows/validate-markdown.yml index 31d12f10579..8b6ea4f6356 100644 --- a/.github/workflows/validate-markdown.yml +++ b/.github/workflows/validate-markdown.yml @@ -27,22 +27,21 @@ jobs: - name: Get changed files id: files - uses: lots0logs/gh-action-get-changed-files@2.1.4 + uses: lots0logs/gh-action-get-changed-files@2.2.2 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Filter and format Markdown files - id: markdown_files run: | MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))') - echo "::set-output name=list::$MARKDOWN_FILES" + echo "MARKDOWN_FILES=$MARKDOWN_FILES" >> $GITHUB_ENV - name: Install markdownlint-cli run: npm install -g markdownlint-cli - name: Auto-fix Markdown files run: | - markdownlint --fix ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json || true + markdownlint --fix $MARKDOWN_FILES --config .markdownlint/config.json || true git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add . @@ -53,13 +52,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Lint Markdown files - id: lint_markdown run: | - markdownlint ${{ steps.markdown_files.outputs.list }} --config .markdownlint/config.json > lint-results.txt 2>&1 || true + markdownlint $MARKDOWN_FILES --config .markdownlint/config.json > lint-results.txt 2>&1 || true if [[ -s lint-results.txt ]]; then echo "Linting errors found" cat lint-results.txt - echo "::set-output name=result::$(cat lint-results.txt)" + echo "LINT_RESULT=$(cat lint-results.txt)" >> $GITHUB_ENV exit 1 fi @@ -86,7 +84,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload PR Comment if: failure() && github.event.pull_request.head.repo.fork == false uses: mshick/add-pr-comment@v2 From feeff83adf8cf07c757fcc724ee5a3cd52f3e467 Mon Sep 17 00:00:00 2001 From: JackDevAU Date: Thu, 9 Nov 2023 04:11:09 +0000 Subject: [PATCH 50/58] fix --- rules/3-steps-to-a-pbi/rule.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index d6ae198794f..2a2e48ce67e 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -62,12 +62,4 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! ::: good ![Figure: The important steps in a PBI lifecycle. Print this "SSW 3 Steps to a PBI pdf" and put it on your 'War Room' wall](3StepsToAPBI.jpg) -::: - -Might get picked up - ---- - -title: test - ---- +::: \ No newline at end of file From b87bce69ccaba47289285554cbfc6030c0b7a202 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Nov 2023 04:12:11 +0000 Subject: [PATCH 51/58] Auto-fix Markdown files --- rules/3-steps-to-a-pbi/rule.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index 2a2e48ce67e..c53049fd2cc 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -62,4 +62,4 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! ::: good ![Figure: The important steps in a PBI lifecycle. Print this "SSW 3 Steps to a PBI pdf" and put it on your 'War Room' wall](3StepsToAPBI.jpg) -::: \ No newline at end of file +::: From 52db2a2f57ccd8d94b9915f263ccde1ec47205d3 Mon Sep 17 00:00:00 2001 From: JackDevAU Date: Thu, 9 Nov 2023 04:15:16 +0000 Subject: [PATCH 52/58] bad markdown --- rules/3-steps-to-a-pbi/rule.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index c53049fd2cc..08be37f0390 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -63,3 +63,13 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! ::: good ![Figure: The important steps in a PBI lifecycle. Print this "SSW 3 Steps to a PBI pdf" and put it on your 'War Room' wall](3StepsToAPBI.jpg) ::: + + +# AA +wads +wdwa + +dwad + +1. aasd + * asd \ No newline at end of file From a0c65e0ab512a2656aac87c2f7d2454c46087426 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Nov 2023 04:21:49 +0000 Subject: [PATCH 53/58] Auto-fix Markdown files --- rules/3-steps-to-a-pbi/rule.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index 08be37f0390..a34238d5635 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -64,12 +64,13 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! ![Figure: The important steps in a PBI lifecycle. Print this "SSW 3 Steps to a PBI pdf" and put it on your 'War Room' wall](3StepsToAPBI.jpg) ::: - # AA + wads wdwa dwad 1. aasd - * asd \ No newline at end of file + +* asd From 42592de8de428e78284c206901007adac6884128 Mon Sep 17 00:00:00 2001 From: JackDevAU Date: Thu, 9 Nov 2023 05:12:36 +0000 Subject: [PATCH 54/58] test --- rules/3-steps-to-a-pbi/rule.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index a34238d5635..82b9b185eb3 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -74,3 +74,29 @@ dwad 1. aasd * asd + + + +::: img-large +![Figure: cache.abf](PBICache.png) +::: +::: img-large +![Figure: The .gitignore file](Gitignore.png) +::: + +::: img-large +![Figure: cache.abf](PBICache.png) +::: + +::: img-large +![Figure: The .gitignore file](Gitignore.png) +::: + +::: img-large +![Figure: cache.abf](PBICache.png) +::: + + +::: img-large +![Figure: The .gitignore file](Gitignore.png) +::: \ No newline at end of file From 01ecd72eee95c0e806e46228cc1c94a5c976b4d7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Nov 2023 05:14:58 +0000 Subject: [PATCH 55/58] Auto-fix Markdown files --- rules/3-steps-to-a-pbi/rule.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index 82b9b185eb3..d2cbde5b1fb 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -75,8 +75,6 @@ dwad * asd - - ::: img-large ![Figure: cache.abf](PBICache.png) ::: @@ -87,7 +85,7 @@ dwad ::: img-large ![Figure: cache.abf](PBICache.png) ::: - + ::: img-large ![Figure: The .gitignore file](Gitignore.png) ::: @@ -96,7 +94,6 @@ dwad ![Figure: cache.abf](PBICache.png) ::: - ::: img-large ![Figure: The .gitignore file](Gitignore.png) -::: \ No newline at end of file +::: From eab85f27b590ffcd11b3d1af3789725ca4438569 Mon Sep 17 00:00:00 2001 From: JackDevAU Date: Thu, 9 Nov 2023 05:27:38 +0000 Subject: [PATCH 56/58] test --- rules/3-steps-to-a-pbi/rule.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index d2cbde5b1fb..c1f610d69f5 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -64,8 +64,6 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! ![Figure: The important steps in a PBI lifecycle. Print this "SSW 3 Steps to a PBI pdf" and put it on your 'War Room' wall](3StepsToAPBI.jpg) ::: -# AA - wads wdwa @@ -75,6 +73,8 @@ dwad * asd + + ::: img-large ![Figure: cache.abf](PBICache.png) ::: @@ -85,7 +85,7 @@ dwad ::: img-large ![Figure: cache.abf](PBICache.png) ::: - + ::: img-large ![Figure: The .gitignore file](Gitignore.png) ::: @@ -94,6 +94,7 @@ dwad ![Figure: cache.abf](PBICache.png) ::: + ::: img-large ![Figure: The .gitignore file](Gitignore.png) -::: +::: \ No newline at end of file From e1ab2758dac97cb2bcfb90b0f2028d64650a1a99 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Nov 2023 05:28:33 +0000 Subject: [PATCH 57/58] Auto-fix Markdown files --- rules/3-steps-to-a-pbi/rule.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index c1f610d69f5..900657e9b5d 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -73,8 +73,6 @@ dwad * asd - - ::: img-large ![Figure: cache.abf](PBICache.png) ::: @@ -85,7 +83,7 @@ dwad ::: img-large ![Figure: cache.abf](PBICache.png) ::: - + ::: img-large ![Figure: The .gitignore file](Gitignore.png) ::: @@ -94,7 +92,6 @@ dwad ![Figure: cache.abf](PBICache.png) ::: - ::: img-large ![Figure: The .gitignore file](Gitignore.png) -::: \ No newline at end of file +::: From c4fd0275325e8a941b8df1ee73f953cd197eb001 Mon Sep 17 00:00:00 2001 From: JackDevAU Date: Thu, 9 Nov 2023 05:33:17 +0000 Subject: [PATCH 58/58] test --- rules/3-steps-to-a-pbi/rule.md | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/rules/3-steps-to-a-pbi/rule.md b/rules/3-steps-to-a-pbi/rule.md index 900657e9b5d..c53049fd2cc 100644 --- a/rules/3-steps-to-a-pbi/rule.md +++ b/rules/3-steps-to-a-pbi/rule.md @@ -63,35 +63,3 @@ Congrats, your PBI is now ready to be demonstrated during your Sprint Review! ::: good ![Figure: The important steps in a PBI lifecycle. Print this "SSW 3 Steps to a PBI pdf" and put it on your 'War Room' wall](3StepsToAPBI.jpg) ::: - -wads -wdwa - -dwad - -1. aasd - -* asd - -::: img-large -![Figure: cache.abf](PBICache.png) -::: -::: img-large -![Figure: The .gitignore file](Gitignore.png) -::: - -::: img-large -![Figure: cache.abf](PBICache.png) -::: - -::: img-large -![Figure: The .gitignore file](Gitignore.png) -::: - -::: img-large -![Figure: cache.abf](PBICache.png) -::: - -::: img-large -![Figure: The .gitignore file](Gitignore.png) -:::