Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XS✔ ◾ [⚠️Don't Merge] More Tests #7208

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0f8af30
🔧 add markdown lint
JackDevAU Nov 8, 2023
43427bd
✏️ Fix name of action
JackDevAU Nov 8, 2023
c641467
💥 issues?
JackDevAU Nov 8, 2023
32caa38
test
JackDevAU Nov 8, 2023
3c8fe63
test
JackDevAU Nov 8, 2023
94ac68a
test
JackDevAU Nov 8, 2023
cec4ea1
test
JackDevAU Nov 8, 2023
0cb5408
update
JackDevAU Nov 8, 2023
cf865e9
test
JackDevAU Nov 8, 2023
f030821
try default
JackDevAU Nov 8, 2023
de181ac
test
JackDevAU Nov 8, 2023
269c4d5
test
JackDevAU Nov 8, 2023
02b90b0
test
JackDevAU Nov 8, 2023
d72666a
fix
JackDevAU Nov 8, 2023
3009e4c
test
JackDevAU Nov 8, 2023
517f630
test
JackDevAU Nov 8, 2023
9a4309f
fix config
JackDevAU Nov 8, 2023
b9987e0
test
JackDevAU Nov 8, 2023
aa83064
test
JackDevAU Nov 8, 2023
d2acb3b
test
JackDevAU Nov 8, 2023
a7f8b31
update
JackDevAU Nov 8, 2023
a72d73f
add id
JackDevAU Nov 8, 2023
6ab5aa8
test
JackDevAU Nov 8, 2023
7c2e891
test
JackDevAU Nov 8, 2023
3e23f17
test 2
JackDevAU Nov 8, 2023
bb470eb
up
JackDevAU Nov 8, 2023
f6bed3e
comment
JackDevAU Nov 8, 2023
b2ea9b8
comment 2
JackDevAU Nov 8, 2023
3a7f7f6
test
JackDevAU Nov 8, 2023
0356bb8
test
JackDevAU Nov 8, 2023
a77393b
fix
JackDevAU Nov 8, 2023
d5fa4c0
test
JackDevAU Nov 8, 2023
f44ebaf
test
JackDevAU Nov 8, 2023
f99f63b
suggestions
JackDevAU Nov 8, 2023
43bdd58
suggestions 2
JackDevAU Nov 8, 2023
137c5b9
test
JackDevAU Nov 8, 2023
c8f3698
test
JackDevAU Nov 8, 2023
ab9e8bb
change order
JackDevAU Nov 8, 2023
3fe8e3e
reorder
JackDevAU Nov 8, 2023
7ab134a
fix comment
JackDevAU Nov 8, 2023
a697b22
Add Markdown linting error details to pull request
JackDevAU Nov 8, 2023
51994ac
Apply auto-fix for Markdown files and disable
JackDevAU Nov 8, 2023
7c9b1e6
test fixes
JackDevAU Nov 8, 2023
e58dd4a
Fix permissions in validate-markdown workflow
JackDevAU Nov 8, 2023
61199d0
Auto-fix Markdown files
github-actions[bot] Nov 8, 2023
c65b3e5
Remove unnecessary lines in rule.md
JackDevAU Nov 8, 2023
c80ca18
Auto-fix Markdown files
github-actions[bot] Nov 8, 2023
58f22a6
Add title to PBI rule.md
JackDevAU Nov 8, 2023
1a54646
Merge branch 'test-markdownlint' of https://github.com/SSWConsulting/…
JackDevAU Nov 8, 2023
f02a602
test
JackSAE Nov 9, 2023
feeff83
fix
JackDevAU Nov 9, 2023
b87bce6
Auto-fix Markdown files
github-actions[bot] Nov 9, 2023
52db2a2
bad markdown
JackDevAU Nov 9, 2023
a0c65e0
Auto-fix Markdown files
github-actions[bot] Nov 9, 2023
42592de
test
JackDevAU Nov 9, 2023
01ecd72
Auto-fix Markdown files
github-actions[bot] Nov 9, 2023
eab85f2
test
JackDevAU Nov 9, 2023
e1ab275
Auto-fix Markdown files
github-actions[bot] Nov 9, 2023
c4fd027
test
JackDevAU Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/validate-markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Validate-Markdown

on:
pull_request:
branches: [ main ]
paths:
- '**.md'

workflow_dispatch:

jobs:
validate-markdown:
runs-on: ubuntu-latest
permissions:
contents: write
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/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Filter and format Markdown files
run: |
MARKDOWN_FILES=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[] | select(endswith(".md"))')
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 $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 .
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
run: |
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 "LINT_RESULT=$(cat lint-results.txt)" >> $GITHUB_ENV
exit 1
fi

- name: Comment on PR with linting errors
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_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_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_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
with:
message-path: pr_comment.md
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: true
17 changes: 17 additions & 0 deletions .markdownlint/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"default": true,
"MD003": {
"style": "atx"
},
"MD004": {
"style": "asterisk"
},
"MD033": {
"allowed_elements": [
"details",
"summary"
]
},
"MD046": false,
"MD013": false
}
2 changes: 1 addition & 1 deletion rules/3-steps-to-a-pbi/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Loading