Skip to content

Commit a5a8d8a

Browse files
authored
Merge pull request #66 from 404-code-not-found-com/feature/taskfile-updates
feature/taskfile updates
2 parents 6d73d82 + bfdfc0a commit a5a8d8a

File tree

2 files changed

+46
-13
lines changed

2 files changed

+46
-13
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ repos:
1414
language: system
1515
stages: ["pre-commit", "pre-push"]
1616
- repo: https://github.com/pre-commit/pre-commit-hooks
17-
rev: v5.0.0
17+
rev: v6.0.0
1818
hooks:
1919
- id: check-merge-conflict
2020
- id: end-of-file-fixer
2121
- id: no-commit-to-branch
2222
- repo: https://github.com/antonbabenko/pre-commit-terraform
23-
rev: v1.99.0
23+
rev: v1.104.0
2424
hooks:
2525
- id: terraform_fmt
2626
- id: terraform_validate

Taskfile.yaml

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,28 @@ version: "3"
66
vars:
77
CURRENT_DATE:
88
sh: date +"%Y-%m-%dT%H-%M-%S%Z"
9+
CAL_VER_DATE:
10+
sh: date -u +"%Y.%m%d.%H%M"
911

1012
tasks:
1113
default:
14+
desc: Show available tasks
1215
cmds:
13-
- task: pre
16+
- task --list-all
1417

15-
hog:
18+
help:
19+
desc: Show this help message
1620
cmds:
17-
- trufflehog git file://. --since-commit HEAD --only-verified --fail
21+
- task --list-all
1822

19-
log:
23+
hog:
2024
cmds:
2125
- |
22-
git-chglog --next-tag v$(autotag -vn --scheme=conventional) -o CHANGELOG.md
23-
pre-commit run end-of-file-fixer --files CHANGELOG.md || true
24-
git add CHANGELOG.md
25-
git commit -m 'chore: update CHANGELOG.md'
26+
trufflehog git file://. \
27+
--since-commit HEAD \
28+
--only-verified \
29+
--fail \
30+
--no-update
2631
2732
mr:
2833
desc: "Create Merge Request and Merge"
@@ -60,8 +65,8 @@ tasks:
6065
tag:*:*:
6166
desc: "Create a signed tag with a message"
6267
vars:
63-
TAG_NAME: "{{index .MATCH0}}"
64-
TAG_MESSAGE: "{{index .MATCH1}}"
68+
TAG_NAME: "{{index .MATCH 0}}"
69+
TAG_MESSAGE: "{{index .MATCH 1}}"
6570
cmds:
6671
- git push
6772
- git tag -s {{.TAG_NAME}} -m "{{.TAG_MESSAGE}}"
@@ -70,8 +75,36 @@ tasks:
7075
tag:*:
7176
desc: "Create a signed tag with tag as message"
7277
vars:
73-
TAG_NAME: "{{index .MATCH0}}"
78+
TAG_NAME: "{{index .MATCH 0}}"
7479
cmds:
7580
- git push
7681
- git tag -s {{.TAG_NAME}} -m "{{.TAG_NAME}}"
7782
- git push --tags
83+
84+
tag0:
85+
desc: "Create first tag on repo"
86+
cmds:
87+
- git push
88+
- git tag -s v0.0.0 -m "v0.0.0 - First Tag 🤠"
89+
- git push --tags
90+
91+
tagauto:
92+
desc: "Create a signed tag with auto semantic versioning"
93+
cmds:
94+
- git push
95+
- |
96+
LAST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
97+
if [[ -z "$LAST_TAG" ]]; then
98+
git tag -s v0.0.0 -m "v0.0.0 - First Tag 🤠"
99+
else
100+
NEW_TAG="v$(autotag -vn --scheme=conventional)"
101+
git tag -s "$NEW_TAG" -m "$NEW_TAG"
102+
fi
103+
- git push --tags
104+
105+
tagcal:
106+
desc: "Create a signed tag with calendar versioning"
107+
cmds:
108+
- git push
109+
- git tag -s v{{.CAL_VER_DATE}} -m "v{{.CAL_VER_DATE}}"
110+
- git push --tags

0 commit comments

Comments
 (0)