diff --git a/.gitea/workflows/proofread.yaml b/.gitea/workflows/proofread.yaml index 1683c5a9..b8490d1d 100644 --- a/.gitea/workflows/proofread.yaml +++ b/.gitea/workflows/proofread.yaml @@ -1,11 +1,11 @@ -name: Spellcheck +name: Fix Markdown typos on: push: - # branches: - # - "*" - # paths: - # - "**/*.md" + branches: + - main + paths: + - "**/*.md" workflow_dispatch: jobs: @@ -14,6 +14,13 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create branch + run: | + git fetch origin main + git checkout -B typos origin/main - name: Fix Markdown typos continue-on-error: true @@ -21,3 +28,29 @@ jobs: with: files: "**/*.md" write_changes: true + + - name: Commit and push fixes + id: changes + run: | + git config user.name "typos-bot" + git config user.email "typos-bot@localhost" + + git add . + git commit -m "fix: correct markdown typos" + git push origin typos --force + + - name: Create pull request + id: pr + uses: actions/pullrequest@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + title: "Fix markdown typos" + body: "Automated typo fixes from crate-ci/typos." + head: typos + base: main + + - name: Show pull request + run: | + echo "PR #${{ steps.pr.outputs.number }}" + echo "${{ steps.pr.outputs.html_url }}" \ No newline at end of file