-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
45 lines (40 loc) · 1.25 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
44
45
---
version: 3
vars:
BRANCH:
sh: if [ $(git rev-parse --abbrev-ref HEAD) != "main" ]; then echo $(git rev-parse --abbrev-ref HEAD) ; fi
tasks:
# ADD TASK FOR LOCAL CALLER CREATION - CREATE TMP FOLDER + MAIN.TF + tfvars
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 pull
- |
echo "ENTER COMMIT MESSAGE"
read COMMIT_MESSAGE;
git add *
git add .github/workflows/*
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 20s
- 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