parent
0f49ce4ade
commit
8852a81d4c
|
|
@ -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.'
|
||||
|
|
|
|||
Loading…
Reference in New Issue