Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/warn_main_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Warn PR targets main

on:
pull_request_target:
types: [opened, edited]
branches:
- main

jobs:
warn:
if: github.repository_owner == 'loopandlearn'
runs-on: ubuntu-latest

permissions:
pull-requests: write

steps:
- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: '⚠️ This PR targets the `main` branch. We do not accept PRs directly to `main` — please retarget your PR to the `dev` branch instead.'
});