Skip to content

Commit

Permalink
revert to ivy-gardener
Browse files Browse the repository at this point in the history
  • Loading branch information
NripeshN committed Sep 25, 2023
1 parent fa82895 commit 5ca6c5e
Showing 1 changed file with 6 additions and 61 deletions.
67 changes: 6 additions & 61 deletions .github/workflows/pr-lint-bot.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 "[email protected]"
git config --local user.name "ivy-branch"
git add .
git commit -m "πŸ€– Lint code"
git push
fix-linting:
name: PR Lint Bot
uses: unifyai/workflows/.github/workflows/pr-lint-bot.yml@main
secrets: inherit

0 comments on commit 5ca6c5e

Please sign in to comment.