Skip to content

Commit

Permalink
Merge pull request #13 from KinanaDB/feat/devops
Browse files Browse the repository at this point in the history
feature(devops-work): add github action
  • Loading branch information
Mohamed-khattab authored Feb 9, 2024
2 parents 2bdb239 + 31dfcc9 commit 2a22a20
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/prevent-direct-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Prevent Direct Pushes to Main

on:
push:
branches:
- main

jobs:
prevent_direct_push:
runs-on: ubuntu-latest

steps:
- name: Check if push is direct to main and not a force push
if: >
github.ref == 'refs/heads/main' &&
github.event_name == 'push' &&
github.event.pull_request == null &&
github.event.head_commit != null
run: exit 1 # Exit with an error code to fail the workflow

0 comments on commit 2a22a20

Please sign in to comment.