Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

Commit 03c49f2

Browse files
Merge pull request #4 from TheRefraction/dev
Added merge branch restrictions
2 parents 365ceda + aa7141c commit 03c49f2

7 files changed

Lines changed: 44 additions & 26 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MYSQL_HOST=mysql
2-
MYSQL_DATABASE=
2+
MYSQL_DATABASE=wonka_db
33
MYSQL_USER=
44
MYSQL_PASSWORD=
55
MYSQL_ROOT_PASSWORD=
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Restrict merge source
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- dev
8+
- docs
9+
10+
jobs:
11+
check-source-branch:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check that PR source is 'dev'
15+
run: |
16+
if [ "${{ github.base_ref }}" == "master" ]; then
17+
if [ "${{ github.head_ref }}" != "dev" ] && [ "${{ github.head_ref }}" != "docs" ]; then
18+
echo "PRs to master are only allowed from the 'dev' or 'docs' branch."
19+
echo "Source branch was: ${{ github.head_ref }}"
20+
exit 1
21+
fi
22+
fi
23+
24+
if [ "${{ github.base_ref }}" == "dev" ] && [ "${{ github.head_ref }}" == "master" ]; then
25+
echo "Merges from 'master' to 'dev' are not allowed."
26+
exit 1
27+
fi
28+
29+
if [ "${{ github.base_ref }}" == "docs" ]; then
30+
echo "No merges are allowed onto 'docs'."
31+
exit 1
32+
fi
33+
34+
if [ "${{ github.head_ref }}" == "docs" ] && [ "${{ github.base_ref }}" != "master" ]; then
35+
echo "'docs' can only be merged into 'master'."
36+
echo "Target branch was: ${{ github.base_ref }}"
37+
exit 1
38+
fi
39+
40+
echo "Source branch is allowed. Proceeding."

db/init/01_schema.sql

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
1-
CREATE DATABASE IF NOT EXISTS test_db;
2-
USE test_db;
3-
4-
CREATE TABLE users (
5-
id INT AUTO_INCREMENT PRIMARY KEY,
6-
name VARCHAR(100) NOT NULL,
7-
email VARCHAR(100) UNIQUE NOT NULL,
8-
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
9-
);
10-
11-
CREATE TABLE products (
12-
id INT AUTO_INCREMENT PRIMARY KEY,
13-
name VARCHAR(100) NOT NULL,
14-
price DECIMAL(10,2) NOT NULL
15-
);
1+
CREATE DATABASE IF NOT EXISTS wonka_db;
2+
USE wonka_db;

db/init/02_seed.sql

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
USE test_db;
2-
3-
INSERT INTO users (name, email) VALUES
4-
('Alice', 'alice@example.com'),
5-
('Bob', 'bob@example.com');
6-
7-
INSERT INTO products (name, price) VALUES
8-
('Widget A', 9.99),
9-
('Widget B', 19.99);
1+
/*USE wonka_db;*/

src/info.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/resources/test.jpg

889 KB
Loading

src/style/style.css

Whitespace-only changes.

0 commit comments

Comments
 (0)