mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2024-12-23 05:05:33 +00:00
caa5cf55ed
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
name: Check formatting
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
checks: write
|
|
|
|
jobs:
|
|
black:
|
|
name: Python Black
|
|
runs-on: ubuntu-latest
|
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install black
|
|
run: pip install black
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config --global user.name github-actions[bot]
|
|
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
|
|
- name: Run black
|
|
run: python -m black .
|
|
|
|
- name: Check if files have been modified
|
|
id: mod_check
|
|
run: |
|
|
[[ $(git status -s | wc -l) -le 1 ]] \
|
|
&& echo "is-dirty=false" >> "$GITHUB_OUTPUT" \
|
|
|| echo "is-dirty=true" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Commit and push changes
|
|
if: steps.mod_check.outputs.is-dirty == 'true'
|
|
run: |
|
|
git add .
|
|
git commit -m "Apply black formatting"
|
|
git push
|
|
|
|
fork-black:
|
|
name: Python Black
|
|
runs-on: ubuntu-latest
|
|
if: github.event.pull_request.head.repo.full_name != github.repository
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: psf/black@stable
|
|
|