-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
43 lines (39 loc) · 1.21 KB
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
version: 3
vars:
BRANCH:
sh: if [ $(git rev-parse --abbrev-ref HEAD) != "main" ]; then echo $(git rev-parse --abbrev-ref HEAD); else echo main ; fi
tasks:
branch:
desc: Create branch from main
cmds:
- git checkout main
- git branch
- git pull
- |
echo "Enter to be created (remote) branch:"
read BRANCH_NAME;
git checkout -b ${BRANCH_NAME}
git push origin ${BRANCH_NAME}
- git branch
- git branch --set-upstream-to=origin/main ${BRANCH_NAME}
commit:
desc: Commit + push code into branch
cmds:
- git branch --set-upstream-to=origin/{{ .BRANCH }}
- git pull
- |
echo "ENTER COMMIT MESSAGE"
read COMMIT_MESSAGE;
git add *
git commit -am "$(echo ${COMMIT_MESSAGE})"
git push origin -u {{ .BRANCH }}
pr:
desc: Create pull request into main
cmds:
- task: commit
- gh pr create -t "{{ .BRANCH }}" -b "{{ .BRANCH }} branch into main"
- sleep 10s
#- gh pr checks $(gh pr list | grep "^[^#;]" | awk '{print $1}') --watch
- gh pr merge $(gh pr list | grep "^[^#;]" | awk '{print $1}') --auto --rebase --delete-branch
- git checkout main && git pull