Merge dev into master: Remove duplicate test job from publish workflow #20
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: Linthttps://github.com/shoumikchow/bbox-visualizer/pull/34/conflict?name=.github%252Fworkflows%252Fblack.yml&base_oid=8dbdb03a0f3c4d41b7135253ebeeaa0845a4b889&head_oid=277ad307e92b68c3a855728a7f11aeda4c5ed629 | |
on: [push, pull_request] | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Black | |
run: pip install black | |
- name: Run Black | |
id: black | |
continue-on-error: true | |
run: | | |
black --check bbox_visualizer/bbox_visualizer.py tests/test_bbox_visualizer.py | |
echo "has_changes=$?" >> $GITHUB_OUTPUT | |
- name: Format with Black if needed | |
if: steps.black.outputs.has_changes == '1' | |
run: black bbox_visualizer/bbox_visualizer.py tests/test_bbox_visualizer.py | |
- name: Create Pull Request | |
if: steps.black.outputs.has_changes == '1' | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: "style: format code with Black" | |
title: "style: format code with Black" | |
body: | | |
Auto-formatted code with Black. | |
This PR was automatically created by the Black formatting GitHub Action. | |
branch: format-code-with-black | |
base: main | |
delete-branch: true | |
token: ${{ secrets.GITHUB_TOKEN }} |