Skip to content

Refactor stream to use framegrab #46

Refactor stream to use framegrab

Refactor stream to use framegrab #46

Workflow file for this run

name: auto-format
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format:
# Check if the PR is not from a fork
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Ruff
run: pip install ruff
- name: Run Ruff format
run: ruff format src/
- name: Run Ruff lint with fixes
run: ruff check --fix src/ --exit-zero
- name: Check if any files were modified
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 needed
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Auto-format Bot'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Automatically reformatting code with ruff"
git push