Skip to content
Merged
Changes from all commits
Commits
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
20 changes: 18 additions & 2 deletions .github/workflows/vale-autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:

concurrency:
group: vale-autofix-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
vale-autofix:
Expand All @@ -22,20 +21,37 @@ jobs:
contents: write
pull-requests: write
steps:
- name: Check if triggered by bot commit
id: bot-check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the latest commit author on the PR head
AUTHOR=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }} --jq '.commit.author.name')
echo "Latest commit author: $AUTHOR"
if [ "$AUTHOR" = "github-actions[bot]" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi

- name: Checkout PR branch
if: steps.bot-check.outputs.skip != 'true'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.VALE_TOKEN }}
fetch-depth: 0

- name: Configure git identity
if: steps.bot-check.outputs.skip != 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Get changed markdown files
id: changed-files
if: steps.bot-check.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down Expand Up @@ -179,7 +195,7 @@ jobs:
claude_args: '--allowedTools "Bash(git:*),Read,Write,Edit,Glob,Grep"'

- name: Build and post summary comment
if: steps.vale-initial.outputs.total > 0
if: steps.bot-check.outputs.skip != 'true' && steps.vale-initial.outputs.total > 0
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
Loading