Skip to content

Commit

Permalink
cicd: warn when merging to main
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Nov 13, 2024
1 parent e3baf34 commit 2743376
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/branch-warning.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR branch check

on:
pull_request:
branches:
- main

jobs:
check_branch:
runs-on: ubuntu-latest
steps:
- name: Check PR Source Branch
if: github.event.pull_request.head.ref != 'staging'
run: |
echo "Checking if PR is coming from 'staging' branch"
gh pr comment ${{ github.event.pull_request.number }} \
--body "Hey bud, you're opening a PR to main from a branch that isn't staging. Maybe you know what you're doing, but maybe you also just forgot to change the branch. Take a second to think about it."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2743376

Please sign in to comment.