From 2fb686a5ef9708fc0d79789114e7139796083b46 Mon Sep 17 00:00:00 2001 From: Kaveen Kumarasinghe Date: Sat, 17 Dec 2022 22:08:25 -0500 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b708504..59a5e24 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,24 @@ on: - main jobs: build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: # https://github.com/stefanzweifel/git-auto-commit-action#checkout-the-correct-branch + ref: ${{ github.head_ref }} + - uses: actions/setup-python@v1 + - run: pip install black + - run: black --check . + - name: If needed, commit black changes to a new pull request + if: failure() + run: | + black . + git config --global user.name github-actions + git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com' + # git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY + git commit -am "Format Python code with psf/black push" + git push origin main + deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2