diff --git a/.gitea/workflows/proofread.yaml b/.gitea/workflows/proofread.yaml index 5202860a..3a1a05fc 100644 --- a/.gitea/workflows/proofread.yaml +++ b/.gitea/workflows/proofread.yaml @@ -16,18 +16,26 @@ jobs: uses: actions/checkout@v5 - name: Fix Markdown typos - continue-on-error: true uses: actions/typos@v1.50.3 with: files: "**/*.md" write_changes: true - - name: Commit to branch and push fixes + - name: Check for typo fixes id: changes run: | - git fetch origin main - git checkout -B typos origin/main - + if git diff --quiet; then + echo "No typo fixes needed." + echo "changed=false" >> "${GITHUB_OUTPUT}" + else + echo "changed=true" >> "${GITHUB_OUTPUT}" + fi + + - name: Commit to branch and push fixes + if: steps.changes.outputs.changed == 'true' + run: | + git checkout -B typos + git config user.name "typos-bot" git config user.email "typos-bot@localhost" @@ -36,6 +44,7 @@ jobs: git push origin typos --force - name: Create pull request + if: steps.changes.outputs.changed == 'true' uses: actions/pullrequest@main with: title: "Fix markdown typos"