added a pre-hook to make sure things are linted before commits happen and fixed workflow
Build and Push Image / build-and-push (pull_request) Successful in 1m42s

This commit is contained in:
2026-05-13 23:15:01 -07:00
parent 2c8baa339a
commit 5384aadd7a
2 changed files with 26 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# Check if the lint fix command fails
# If it does, exit with a non-zero status to prevent the commit.
echo "Running lint fix..."
# Replace with your actual lint fix command
# This is just an example, adapt it to your linter and project
npm run lint:fix # e.g., "eslint . --fix"
# Example: Capture the exit code of the command
lint_fix_result=$?
if [ $lint_fix_result -ne 0 ]; then
echo "Linting failed. Commit aborted."
exit 1 # Exit with a non-zero status to prevent the commit
fi
echo "Lint fix completed successfully. Commit allowed."
exit 0 # Exit with a zero status to allow the commit
+6 -1
View File
@@ -1,7 +1,12 @@
name: Build and Push Image
on: [push]
on:
pull_request:
branches:
- main
types: [closed]
jobs:
build-and-push:
if: gitea.event.pull_request.merged == true
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest