Skip to content

Commit

Permalink
Limit autoformat run to only user (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjy5 authored Jan 3, 2024
1 parent 18ef653 commit 63042fa
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/autoformat-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,20 @@ on:
merge_group:

jobs:
autoformat:
autoformat-and-lint:
name: Autoformat and Lint
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: 🛎 Checkout
if: github.event.pull_request.user.login != 'dependabot[bot]'
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.WORKFLOW_COMMIT }}

- name: 🤖🛎 Bot Checkout
if: github.event.pull_request.user.login == 'dependabot[bot]'
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: 🐍 Setup Python
uses: actions/setup-python@v4
with:
Expand All @@ -38,7 +32,6 @@ jobs:
run: hatch fmt -f

- name: ✅ Commit code format changes
if: github.event.pull_request.user.login != 'dependabot[bot]'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Autoformat code"
Expand Down

0 comments on commit 63042fa

Please sign in to comment.