diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..2f580d3 --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,19 @@ +name: black +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 # Use v1, NOT v2 + - 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 "fixup! Format Python code with psf/black push" + git push --force origin HEAD:$GITHUB_REF diff --git a/README.md b/README.md index 3dde2a0..742366e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # GeeksForGeeksScrapper Scrapes [GeeksForGeeks](http://www.geeksforgeeks.org) and creates html & PDF for chosen category along with syntax highlighting for the code. +![black](https://github.com/itsvinayak/GeeksForGeeksScrapper/workflows/black/badge.svg?branch=master&event=push) + ## Screenshots Example of articles of C category as html: