Skip to content

Commit

Permalink
ci: add comment if can't be auto fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
romadryud committed Sep 18, 2024
1 parent 956e9e3 commit 70db923
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Lint

on: workflow_call

permissions: write-all
permissions:
contents: write

jobs:
prettier:
Expand Down Expand Up @@ -30,12 +31,10 @@ jobs:
- name: Run prettier
id: prettier_run
if: steps.prettier_check.outputs.PRETTIER_EXIT_CODE == 1
run: npm run prettify
- name: Commit and push changes
if: ${{ success() && steps.prettier_run.conclusion == 'success' }}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "chore: run prettier"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
json='{"status": "1"}' && echo "$json" > status.json
- uses: actions/upload-artifact@v4
with:
name: status
path: "status.json"

3 changes: 3 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: preview

on: pull_request

permissions:
contents: write

jobs:
lint:
uses: ./.github/workflows/lint.yml
Expand Down

0 comments on commit 70db923

Please sign in to comment.