From ce9dcc8f4f0bc75740300ba31317a44b54192232 Mon Sep 17 00:00:00 2001 From: Shalini Saloni Date: Thu, 27 Feb 2025 23:20:57 +0530 Subject: [PATCH 1/2] Add GitHub Action to block PRs from main branch --- .github/workflows/check-branch.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/check-branch.yml diff --git a/.github/workflows/check-branch.yml b/.github/workflows/check-branch.yml new file mode 100644 index 000000000000..fe6cc87b8782 --- /dev/null +++ b/.github/workflows/check-branch.yml @@ -0,0 +1,19 @@ +name: Enforce PR Branch Naming + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + check-branch-name: + runs-on: ubuntu-latest + steps: + - name: Fail if PR is from 'main' branch + run: | + if [[ "${{ github.head_ref }}" == "main" ]]; then + echo "❌ Pull requests must not be created from the 'main' branch." + echo "❗ Please create a new branch and submit your PR again." + exit 1 + else + echo "✅ Branch name is valid." + fi From a8e4fecd9e016753509e22f4cf1edc579021d48b Mon Sep 17 00:00:00 2001 From: Shalini Saloni Date: Thu, 27 Feb 2025 23:38:45 +0530 Subject: [PATCH 2/2] Added check for branch naming --- opentelemetry.io | 1 + 1 file changed, 1 insertion(+) create mode 160000 opentelemetry.io diff --git a/opentelemetry.io b/opentelemetry.io new file mode 160000 index 000000000000..f67026c1dacf --- /dev/null +++ b/opentelemetry.io @@ -0,0 +1 @@ +Subproject commit f67026c1dacf248845bdfee74400b89810a60bee