This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
Lints the code with ESLint #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Black linter" | |
on: | |
schedule: | |
- cron: "0 3 * * 0" | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: "Lint" | |
runs-on: "ubuntu-latest" | |
timeout-minutes: 10 | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: "Black-ify" | |
uses: "psf/black@stable" | |
with: | |
options: "-v -t py312 --safe --exclude .git .github" | |
- name: "Check for changes" | |
id: git-check | |
run: | | |
git diff --exit-code || echo "##[set-output name=changed;]true" | |
- name: "Commit changes" | |
if: steps.git-check.outputs.changed | |
run: | | |
d=`date '+%Y/%m/%dT%H:%M:%SZ'` | |
git config --local user.email ${{ secrets.GH_EMAIL }} | |
git config --local user.name ${{ secrets.GH_USERNAME }} | |
git add -A | |
git commit -m "Code style changed to Black at ${d}" | |
- name: "Push" | |
if: steps.git-check.outputs.changed | |
uses: "ad-m/github-push-action@v0.8.0" | |
with: | |
force: false | |
directory: '.' | |
branch: ${{ github.ref }} | |
github_token: ${{ secrets.GH_TOKEN }} |