This repo contains a action to run various Python tools including:
inputs:
black:
description: | Run Black Default is false.default: falsebandit:
description: | Run Bandit Default is false.default: falsepylint:
description: | Run Pylint Default is false.default: falsepyright:
description: | Run Pyright Default is false.default: falseflake8:
description: | Run Flake8 Default is false.default: falsetesting:
description: | Run tests with PyTest Default is false.default: falsepublish:
description: | Publish to PyPi Default is falsedefault: falsepublish_url:
description: | PyPi Target. Use this to point to private or test locations. Default https://pypi.orgdefualt: 'https://pypi.org'github_token:
description: 'GITHUB_TOKEN'default: '${{ github.token }}'workdir:
description: 'Working directory relative to the root directory.'default: 'src'### Flags for reviewdog ###level:
description: 'Report level for reviewdog [info,warning,error]'default: 'error'reporter:
description: 'Reporter of reviewdog command [github-pr-check,github-pr-review].'default: 'github-pr-check'filter_mode:
description: | Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. Default is added.default: 'added'fail_on_error:
description: | Exit code for reviewdog when errors are found [true,false] Default is `false`.default: 'false'reviewdog_flags:
description: 'Additional reviewdog flags'default: ''toml:
description: | pyproject.toml location. Default pyproject.tomldefault: 'pyproject.toml'pylint_rc:
description: '.pylintrc configuration file'default: '.pylintrc'name: Pull Requeston:
push:
branches: [ main ]pull_request:
branches: [ main ]workflow_dispatch:
jobs:
linting:
runs-on: ubuntu-lateststeps:
- name: Blackuses: microsoft/action-python@0.7.0with:
black: true
- name: Bandituses: microsoft/action-python@0.7.0with: bandit: true
- name: Pylintuses: microsoft/action-python@0.7.0with:
pylint: true
- name: Pyrightuses: microsoft/action-python@0.7.0with: pyright: true
- name: Flake8uses: microsoft/action-python@0.7.0with: flake8: truetesting:
runs-on: ubuntu-lateststeps: - name: Pytestuses: microsoft/action-python@0.7.0with: testing: trueYou can bump version on merging Pull Requests with specific labels (bump:major,bump:minor,bump:patch). Pushing tag manually by yourself also work.
This action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3. ref: https://help.github.com/en/articles/about-actions#versioning-your-action