push lint output to branch
This commit is contained in:
parent
aa47481f1e
commit
9bb9996dd9
1 changed files with 26 additions and 7 deletions
33
.github/workflows/lint.yaml
vendored
33
.github/workflows/lint.yaml
vendored
|
|
@ -30,11 +30,30 @@ jobs:
|
|||
- id: install-deps
|
||||
name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- id: lint
|
||||
name: Lint code
|
||||
run: npm run lint
|
||||
|
||||
- id: run-linters
|
||||
name: Run linters
|
||||
uses: wearerequired/lint-action@v2
|
||||
with:
|
||||
auto_fix: true
|
||||
eslint: true
|
||||
prettier: true
|
||||
- id: format
|
||||
name: Format code
|
||||
run: npm run format
|
||||
|
||||
- id: get_branch_name
|
||||
name: Get branch name
|
||||
run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
|
||||
|
||||
- id: checkout_branch
|
||||
name: Checkout to branch
|
||||
run: git checkout ${{ env.branch_name }}
|
||||
|
||||
- id: commit_and_push
|
||||
name: Commit and push formatted code
|
||||
run: |
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
git add .
|
||||
git commit --allow-empty -m "lint and format"
|
||||
git push origin HEAD:${{ env.branch_name }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue