This repository was archived by the owner on Jul 20, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11MYSQL_HOST = mysql
2- MYSQL_DATABASE =
2+ MYSQL_DATABASE = wonka_db
33MYSQL_USER =
44MYSQL_PASSWORD =
55MYSQL_ROOT_PASSWORD =
Original file line number Diff line number Diff line change 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."
Original file line number Diff line number Diff line change 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;
Original file line number Diff line number Diff line change 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;*/
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments