From 5ca6c5e2d624c6d57f89245fb637597566b7e92e Mon Sep 17 00:00:00 2001 From: NripeshN Date: Mon, 25 Sep 2023 17:27:59 +0400 Subject: [PATCH] revert to ivy-gardener --- .github/workflows/pr-lint-bot.yml | 67 +++---------------------------- 1 file changed, 6 insertions(+), 61 deletions(-) diff --git a/.github/workflows/pr-lint-bot.yml b/.github/workflows/pr-lint-bot.yml index f7e6e9d1ea7d9..780fcc7bf6031 100644 --- a/.github/workflows/pr-lint-bot.yml +++ b/.github/workflows/pr-lint-bot.yml @@ -1,69 +1,14 @@ name: Trigger lint format on: - pull_request: - types: [ labeled, opened, synchronize, reopened, review_requested ] + issue_comment: + types: [created] permissions: contents: write jobs: - trigger: - runs-on: ubuntu-latest - name: Check for triggers - outputs: - head-ref: ${{ steps.comment-branch.outputs.head_ref }} - head-repo: ${{ steps.comment-branch.outputs.head_owner }}/${{ steps.comment-branch.outputs.head_repo }} - steps: - - uses: KareemMAX/pull-request-comment-branch@head-repo-owner-release - id: comment-branch - - format-code: - needs: trigger - name: Trigger lint bot - runs-on: ubuntu-latest - steps: - - name: Debug - run: | - echo "secrets.IVY_BRANCH_TOKEN: ${{ secrets.IVY_BRANCH_TOKEN }}" - - - name: Checkout 🛎️ ${{ github.event.repository.name }} - uses: actions/checkout@v4 - with: - ref: ${{ needs.trigger.outputs.head-ref }} - repository: ${{ needs.trigger.outputs.head-repo }} - token: ${{ secrets.IVY_BRANCH_TOKEN }} - - - name: Get changed files - id: changed-files - uses: KareemMAX/gh-action-get-changed-files@5a5ee034eff88bee239d4f49cd041fed0bec7480 - with: - token: ${{ secrets.IVY_BRANCH_TOKEN }} - - - name: Setup Python 🐍 - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - - - name: Run pre-commit 🚀 - continue-on-error: true - uses: pre-commit/action@v3.0.0 - with: - extra_args: ${{ true && format('--files {0}', join(fromJSON(steps.changed-files.outputs.all), ' ')) || '--all-files' }} - - - name: Check if there are changes 📝 - id: check - run: | - if [[ -n "$(git status --porcelain)" ]]; then - echo "changes=true" >> $GITHUB_OUTPUT - fi - - - name: Commit changes 📝 - if: steps.check.outputs.changes == 'true' - run: | - git config --local user.email "ivy.branch@lets-unify.ai" - git config --local user.name "ivy-branch" - git add . - git commit -m "🤖 Lint code" - git push \ No newline at end of file + fix-linting: + name: PR Lint Bot + uses: unifyai/workflows/.github/workflows/pr-lint-bot.yml@main + secrets: inherit \ No newline at end of file