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
|
- id: install-deps
|
||||||
name: Install dependencies
|
name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
- id: lint
|
||||||
|
name: Lint code
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
- id: run-linters
|
- id: format
|
||||||
name: Run linters
|
name: Format code
|
||||||
uses: wearerequired/lint-action@v2
|
run: npm run format
|
||||||
with:
|
|
||||||
auto_fix: true
|
- id: get_branch_name
|
||||||
eslint: true
|
name: Get branch name
|
||||||
prettier: true
|
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