Skip to content

Commit

Permalink
ci: add warning on release PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Jan 17, 2025
1 parent 721f6ee commit 6a94dbe
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/warn-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Warn on Release Branch

on:
pull_request:
types: [opened]

jobs:
warn-on-release-branch:
runs-on: ubuntu-latest

steps:
- name: Check if branch name starts with "release"
id: check_branch
run: |
if [[ "${{ github.head_ref }}" == release* ]]; then
echo "branch_is_release=true" >> $GITHUB_ENV
else
echo "branch_is_release=false" >> $GITHUB_ENV
fi
- name: Post warning comment
if: env.branch_is_release == 'true'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: "⚠️ Warning: PR should be **merged** and not **rebased**."
})

0 comments on commit 6a94dbe

Please sign in to comment.