Closed bourdeet closed 6 days ago
What does ;q
do? Would it work if we do | grep -m 1 sec
to only get the first match.
I am not an expert in using GPG keys, and I am not sure where GPG_KEY_ID
here gets set? https://github.com/alexandrainst/alexandra-ml-template/blob/040f85062cd236a16e340274626bb2656ee7911e/%7B%7Bcookiecutter.project_name%7D%7D/makefile#L96C10-L96C20
Actually ;q
is a sed-related command that tells the program to quit after the first find. Another way of achieving the same result would be:
grep sec | sed -E 's/.*\/([^ ]+).*/\1/' | head -n 1
You can test this uing the foolwing line:
echo "sec rsa3072/[KEY_ID_1] 2020-01-01 [SC]
sec rsa3072/[KEY_ID_2] 2021-01-03 [SC]" | grep sec | sed -E 's/.*\/([^ ]+).*/\1/' | head -n 1
Fixed by removing all GPG-related things, as they caused way too many issues.
For some reason I had installed more than one GPG key on my machine, this meant that the output of the following command in the makefile (line 75, ommitting the last pipe):
returned something like:
As a result, the last pipe that uses regex to retrieve the key ID actually returns a string that looks line
and includes therefore a newline character, which breaks the subsequent configuration of the
.env
file.A possible fix could be to add
;q
to the existing regex, such that the command prints out the first available GPG key by default