Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
datpmt committed Nov 28, 2024
1 parent db428b1 commit 80de3d8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/typos-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
python3 -m pip install --upgrade pip
pip install typos
- name: Verify typos installation
run: |
typos --help # This will show the available commands
- name: Get changed files
id: changed-files
run: |
Expand Down Expand Up @@ -79,10 +83,11 @@ jobs:
# Read each typo and create a comment for it
while IFS= read -r line; do
# Match the line that indicates an error and extract info
if [[ "$line" =~ error:\ `([^`]*)`\ should\ be\ `([^`]*)`\ ]]; then
if [[ "$line" =~ error:\ \`([^`]*)\`\ should\ be\ \`([^`]*)\` ]]; then
typo_word="${BASH_REMATCH[1]}"
correction="${BASH_REMATCH[2]}"
line_number=$(echo "$line" | grep -oP '\d+')
# Create a comment on the PR for each error found
comment_body="**Typo found**: \`$typo_word\` (line $line_number) should be \`$correction\`."
pr_number=${{ github.event.pull_request.number }}
Expand Down

0 comments on commit 80de3d8

Please sign in to comment.