Skip to content

Commit 32404c1

Browse files
stepankuzmingithub-actions[bot]
authored andcommitted
Add workflow to block direct PR merges to the public GL JS repo (internal-8840)
GitOrigin-RevId: 7013ff381f9276f3e94e155b798af3e3eb6bdb56
1 parent 64f7556 commit 32404c1

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: External PR Policy
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
block-merge:
9+
name: PR Policy Check (Merge Blocked)
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
steps:
14+
- name: Post guidance comment
15+
uses: thollander/actions-comment-pull-request@v3
16+
with:
17+
comment-tag: external-pr-policy
18+
message: |
19+
Hey, @${{ github.event.pull_request.user.login }} 👋 Thanks for your contribution to Mapbox GL JS!
20+
21+
**Important**: This repository does not accept direct merges. All changes go through our internal review process.
22+
23+
**What happens next:**
24+
1. A team member will review your PR here first
25+
2. If it looks good, they will import it to our internal repository for further review
26+
3. If approved, changes will be synced back here via our release process
27+
28+
Please respond to any review comments on this PR. For more details, see [CONTRIBUTING.md](https://github.com/mapbox/mapbox-gl-js/blob/main/CONTRIBUTING.md).
29+
30+
- name: Block direct merge
31+
run: |
32+
echo "::error title=Direct Merge Blocked::This repository does not accept direct PR merges."
33+
echo ""
34+
echo "All changes to Mapbox GL JS must go through internal review."
35+
echo "A team member will review your PR and import it if approved."
36+
echo ""
37+
echo "See CONTRIBUTING.md for details on our contribution process."
38+
exit 1

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ Here is a recommended way to get setup:
139139
* We use [Copybara](https://github.com/google/copybara) to sync changes between this public GitHub repository and the Mapbox internal codebase
140140
* After your PR is approved and reviewed, the GL JS team manually merges it into the Mapbox internal codebase
141141
* Once merged internally, Copybara automatically syncs the changes back to this public repository
142-
* **Note:** Your PR will appear as "Closed" rather than "Merged" on GitHub after it has been merged internally. This is expected - the changes are included via the Copybara sync process
142+
* **Note:** Your PR will appear as "Closed" rather than "Merged" on GitHub after it has been merged internally. This is expected - the changes are included via our internal sync process
143+
* **PR Policy Check:** A required status check prevents direct merges to this repository. This is intentional - your PR will be reviewed here first, then imported and reviewed internally if approved. Changes are synced back to this repository after internal merge.
143144

144145
```mermaid
145146
flowchart TB

0 commit comments

Comments
 (0)