diff --git a/.github/workflows/PR-validator.yml b/.github/workflows/PR-validator.yml new file mode 100644 index 0000000..e328899 --- /dev/null +++ b/.github/workflows/PR-validator.yml @@ -0,0 +1,17 @@ +name: PR Validator + +on: + pull_request: + types: [opened, synchronize] + +jobs: + validate-pr: + runs-on: ubuntu-latest + steps: + - name: Check PR Title Format + run: | + PR_TITLE="${{ github.event.pull_request.title }}" + if [[ ! "$PR_TITLE" =~ ^(feature|bugfix|hotfix)/[a-z0-9-]+$ ]]; then + echo "❌ Pull request title must follow the format: feature/branch-name, bugfix/branch-name, or hotfix/branch-name" + exit 1 + fi diff --git a/main.py b/main.py index 3dc05cc..3b1b9d4 100644 --- a/main.py +++ b/main.py @@ -2,4 +2,5 @@ print("This is DEV2: you are a pussy DEV1") print("Welcome to DevOps practise") print("You are a pussy - DEV1 BRANCH & dont delete me") -print("This is a hotfix") \ No newline at end of file +print("This is a hotfix") +print("You better deny this boy") \ No newline at end of file