Skip to content

Commit c1b647d

Browse files
committed
branch protection
1 parent d6c1ab7 commit c1b647d

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.github/branch-protection.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
required_status_checks:
2+
strict: true
3+
4+
contexts:
5+
- "Lint and Format Check"
6+
7+
require_branches_up_to_date: true

.github/workflows/build-and-publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ env:
1616

1717
jobs:
1818
lint:
19+
name: Lint and Format Check
1920
runs-on: ubuntu-latest
2021
permissions:
2122
contents: read
23+
outputs:
24+
success: ${{ steps.lint.outputs.success }}
2225

2326
steps:
2427
- name: Checkout repository
@@ -33,16 +36,21 @@ jobs:
3336
run: pip install ruff
3437

3538
- name: Run linting
39+
id: lint
3640
run: |
3741
echo "Running ruff check..."
3842
ruff check . --output-format=github
3943
4044
echo "Running ruff format check..."
41-
ruff format --check . --output-format=github
45+
ruff format --check .
46+
47+
echo "success=true" >> $GITHUB_OUTPUT
4248
4349
build-and-push-image:
50+
name: Build and Push Docker Image
4451
runs-on: ubuntu-latest
45-
needs: lint
52+
needs: [lint]
53+
if: needs.lint.outputs.success == 'true'
4654
permissions:
4755
contents: read
4856
packages: write

0 commit comments

Comments
 (0)