You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/pr_creation.yml
+15-16Lines changed: 15 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ jobs:
25
25
with:
26
26
fetch-depth: 0
27
27
28
-
- name: Set up GH CLI
28
+
- name: Install GitHub CLI
29
29
run: |
30
30
sudo apt update
31
31
sudo apt install -y gh
@@ -37,15 +37,14 @@ jobs:
37
37
gh auth setup-git
38
38
gh auth status
39
39
40
-
41
40
- name: Create branches if not exist
42
41
run: |
43
42
fname=${FEATURE_NAME}
44
-
base=main
43
+
base=master
45
44
46
45
echo "Creating branches for feature: $fname"
47
46
48
-
# Function to create branch if not exists
47
+
# Helper to create branch from base if not exists
49
48
create_branch() {
50
49
branch=$1
51
50
from=$2
@@ -59,33 +58,33 @@ jobs:
59
58
fi
60
59
}
61
60
62
-
create_branch src/$fname main
63
-
create_branch doc/$fname main
61
+
create_branch src/$fname $base
62
+
create_branch doc/$fname $base
64
63
create_branch test/$fname src/$fname
65
-
create_branch feature/$fname main
64
+
create_branch feature/$fname $base
66
65
67
66
- name: Create draft PRs
68
67
run: |
69
68
fname=${FEATURE_NAME}
70
69
71
70
echo "Creating draft PRs for $fname"
72
71
73
-
# Helper function to check and create PR
74
72
create_pr() {
75
73
head=$1
76
74
base=$2
77
75
title=$3
78
76
assignee=$4
79
77
80
-
if ! gh pr list --head $head --base $base --json headRefName,baseRefName --jq '.[] | select(.headRefName=="'$head'" and .baseRefName=="'$base'")' >/dev/null; then
0 commit comments