Skip to content

feat(core): Allow GPG parameters and ignore git hooks. #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/cli/src/bin/decryptKeyPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ if (argv[2] === "-h" || argv[2] === "--help") {

const { shares } = yaml.load(yamlString) as VoteFileFormat;
const ac = new AbortController();
const gpgParams = (process.env.CARITAT_GPG_PARAMS ?? "").split(/\s/g);
const out = await Promise.any(
shares.map(async (share) => {
const cp = spawn(env.GPG_BIN || "gpg", ["-d"], {
stdio: ["pipe", "pipe", "inherit"],
const cp = spawn(env.GPG_BIN || "gpg", ["-d", ...gpgParams], {
stdio: [
"pipe",
"pipe",
process.env.CARITAT_SHOW_ERRORS ? "inherit" : "ignore",
],
signal: ac.signal,
});
const stdout = cp.stdout.toArray();
Expand Down
2 changes: 1 addition & 1 deletion sh/voteUsingGit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $EDITOR "$tmpDir/$path/ballot.yml"
# Commit the encrypted JSON vote data.
(cd "$tmpDir" && \
git add "$tmpDir/$path/$username.json" && \
git commit -m "vote from $username")
git commit -n -m "vote from $username")

# Pushing to the remote repository.
(cd "$tmpDir" && \
Expand Down