diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2f5ff5b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,37 @@ + +name: Formatting python code +on: + push: + paths: + - '**.py' + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + tags: + description: 'Test scenario tags' +jobs: + autoyapf: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + with: + ref: ${{ github.head_ref }} + - name: autoyapf + id: autoyapf + uses: mritunjaysharma394/autoyapf@v2 + with: + args: --style pep8 --recursive --in-place . + - name: Check for modified files + id: git-check + run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) + - name: Push changes + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.name 'Aatmaj-Zephyr' + git config --global user.email 'Aatmaj-Zephyr@users.noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + git commit -am "Automated autoyapf fixes" + git push