Files
Auto-GPT/.github/workflows/auto_format.yml
Toran Bruce Richards dfd324a079 Updates auto format workflow to work with forks.
(in the correct branch now)
2023-04-02 10:31:06 +01:00

25 lines
949 B
YAML

name: auto-format
on: pull_request
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: autopep8
uses: peter-evans/autopep8@v1
with:
args: --exit-code --recursive --in-place --aggressive --aggressive .
- name: Check for modified files
id: git-check
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT
- name: Push changes
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Torantulino'
git config --global user.email 'toran.richards@gmail.com'
git remote set-url origin https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Automated changes"
git push