From 0fd4583646a6cacb5bcaaff2fe20d60c48636490 Mon Sep 17 00:00:00 2001 From: cdnninja Date: Fri, 19 Nov 2021 15:13:18 -0700 Subject: [PATCH] feat: Lint Black Auto Correction for Remote Fork (#157) * feat: Lint Black Auto Correction for Remote Fork * Update lint.yaml --- .github/workflows/lint.yaml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 38f692f4..7d4b84b6 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,7 +1,7 @@ name: Lint on: - pull_request: + pull_request_target: branches: - master @@ -26,28 +26,19 @@ jobs: with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} - - name: Set up Python uses: actions/setup-python@v2 id: python with: python-version: "3.x" - - name: Install pre-commit run: | python3 -m pip install pre-commit pre-commit install-hooks --config .github/pre-commit-config.yaml - name: Run the check (${{ matrix.checks }}) run: pre-commit run --hook-stage manual ${{ matrix.checks }} --all-files --config .github/pre-commit-config.yaml - - name: Set Lint branch name - if: failure() - id: vars - run: echo ::set-output name=branch-name::"${{ matrix.checks }}/${{ github.head_ref }}" - - name: Create Pull Request + - name: Commit Changes if: failure() - uses: peter-evans/create-pull-request@v3 + uses: stefanzweifel/git-auto-commit-action@v4 with: - commit-message: action fixes automatically created. - title: "fix: ${{ matrix.checks }} action" - body: This is an auto-generated PR with fixes by ${{ matrix.checks }} - branch: ${{ steps.vars.outputs.branch-name }} + commit_message: "fix: ${{ matrix.checks }} action"