Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
fast-forward

GitHub Action

Autopep8 Action

v1.1

Autopep8 Action

fast-forward

Autopep8 Action

Automatically runs the autopep8 command on all your changes

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Autopep8 Action

uses: creyD/[email protected]

Learn more about this action in creyD/autopep8_action

Choose a version

GitHub autopep8 Action

This action uses the newly released GitHub action to automatically restyle your Python code according to PEP-8 using autopep8.

Usage

Parameters

The following parameters can be used in your custom action configuration.

Parameter Required Default Description
commit_message 'Adjusted files for PEP-8 compliance' Custom git commit message
commit_options '*' Custom git commit options
file_pattern '.' Custom file pattern for git add
dependencies 'requirements.txt' Path for the repositories 'requirements.txt'. If you have none, you may skip this.
branch - The specific branch you want to merge into. Use ${{ github.head_ref }} if you want to use this with pull requests.

Example

This is a simple usage example of this script:

name: Autopep 8

on: [pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
      with:
        fetch-depth: 1
    - uses: creyD/action_autopep8@master
      with:
        dependencies: 'requirements.txt'
        branch: ${{ github.head_ref }}
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Issues

Please report all bugs and feature request using the GitHub issues function.

Special Thanks

  • Hideo Hattori (GitHub) for creating and maintaining autopep8
  • Stefan Zweifel (GitHub) for providing an action to commit and push a git change