Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-09-22 20:03:36 +08:00
parent 0f49ce4ade
commit 8852a81d4c
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 4 additions and 2 deletions

View File

@ -7,11 +7,14 @@ on:
jobs:
auto-fix:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
@ -42,14 +45,13 @@ jobs:
git config --local user.name "GitHub Action"
git add -A
git commit -m "chore: auto-fix linting and formatting issues"
git push
git push origin HEAD:${{ github.head_ref }}
- name: Add PR comment
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const changes = ${{ steps.git-check.outputs.changes == 'true' }};
const message = changes
? 'Linting and formatting issues were automatically fixed. Please review the changes.'