Skip to content

Commit

Permalink
Update autopep8.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
BluemlJ authored Dec 16, 2024
1 parent 0715cc8 commit 1d6191c
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/autopep8.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
name: autopep8
name: Format python code
on: pull_request
jobs:
autopep8:
# Check if the PR is not raised by this workflow and is not from a fork
if: startsWith(github.head_ref, 'autopep8-patches') == false && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: autopep8
id: autopep8
uses: peter-evans/autopep8@v2
with:
args: --exit-code --recursive --in-place --aggressive --aggressive .
- name: Set autopep8 branch name
id: vars
run: |
branch-name="autopep8-patches/${{ github.head_ref }}"
echo "branch-name=$branch-name" >> $GITHUB_OUTPUT
args: --recursive --in-place --aggressive --aggressive .
- name: Create Pull Request
if: steps.autopep8.outputs.exit-code == 2
uses: peter-evans/create-pull-request@v3
with:
commit-message: autopep8 action fixes
title: Fixes by autopep8 action
body: This is an auto-generated PR with fixes by autopep8.
labels: autopep8, automated pr
reviewers: peter-evans
branch: ${{ steps.vars.outputs.branch-name }}
- name: Fail if autopep8 made changes
if: steps.autopep8.outputs.exit-code == 2
run: exit 1
branch: autopep8-patches

0 comments on commit 1d6191c

Please sign in to comment.