Skip to content

Commit e7d4728

Browse files
committed
fix(deploy): commit changes to current branch instead
Committing the changes to another branch and switching back means the newly added keys are not present in the .sops.yaml file in the branch that we are working in. There isn't really a need to push the changes to another branch or the remote. I'd rather commit changes into the host branch I'm currently working on so as to keep these changes together in their own PR.
1 parent 1455d45 commit e7d4728

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

scripts/git.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
#!/usr/bin/env sh
22

33
cmd_git() {
4-
remote="$(git symbolic-ref refs/remotes/origin/HEAD)"
54
stash_label="$(od -An -N8 -tx1 /dev/urandom | tr -d ' \n')"
65

7-
main_branch="${remote##*/}"
8-
current_branch="$(git branch --show-current)"
9-
106
git stash -m "$stash_label"
11-
git checkout "$main_branch"
127

138
"$@"
149

1510
git add .
1611
git commit -m "chore(sops): generated and rekeyed secrets for host_${HOST}"
17-
git push
1812

19-
git checkout "$current_branch"
2013
git stash list | grep "${stash_label}" && git stash pop --index
2114
}

0 commit comments

Comments
 (0)