From 758543cc694f49286f445dd4577effe51b5a9ebd Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Tue, 6 Jul 2021 11:34:51 -0700 Subject: [PATCH] Push automated code fixes. --- .github/workflows/frontendlint.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/frontendlint.yml b/.github/workflows/frontendlint.yml index 589dc66380..51e2759020 100644 --- a/.github/workflows/frontendlint.yml +++ b/.github/workflows/frontendlint.yml @@ -38,4 +38,22 @@ jobs: yarn --frozen-lockfile npm rebuild node-sass - name: Run tests - run: yarn run lint-all + run: yarn run lint-all:fix + - name: Check for modified files + if: github.event.pull_request && github.event.pull_request.head.repo.full_name == github.repository + id: git-check + run: echo ::set-output name=modified::$(git diff-index --name-only HEAD) + - uses: tibdex/github-app-token@v1 + if: github.event.pull_request && github.event.pull_request.head.repo.full_name == github.repository && steps.git-check.outputs.modified != '' + id: generate-token + with: + app_id: ${{ secrets.CODE_FIX_APP_ID }} + private_key: ${{ secrets.CODE_FIX_APP_PRIVATE_KEY }} + - name: Push changes + if: github.event.pull_request && github.event.pull_request.head.repo.full_name == github.repository && steps.git-check.outputs.modified != '' + run: | + git config --global user.name 'Learning Equality' + git config --global user.email 'dev@learningequality.org' + git remote set-url origin https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com/${{ github.repository }} + git commit -am "Frontend linting of ${{ steps.git-check.outputs.modified }}" + git push