Skip to content

Dont hardcode keygrip in releases workflow#6202

Merged
samcoe merged 1 commit intotrunkfrom
release-workflow-gpg
Sep 6, 2022
Merged

Dont hardcode keygrip in releases workflow#6202
samcoe merged 1 commit intotrunkfrom
release-workflow-gpg

Conversation

@samcoe
Copy link
Contributor

@samcoe samcoe commented Sep 6, 2022

This PR changes the hardcoded keygrip to now read from secrets.

@samcoe samcoe requested a review from mislav September 6, 2022 12:46
@samcoe samcoe self-assigned this Sep 6, 2022
@samcoe samcoe requested a review from a team as a code owner September 6, 2022 12:46
echo "allow-preset-passphrase" > ~/.gnupg/gpg-agent.conf
gpg-connect-agent RELOADAGENT /bye
echo "${{secrets.GPG_PASSPHRASE}}" | /usr/lib/gnupg2/gpg-preset-passphrase --preset 867DAD5051270B843EF54F6186FA10E3A1D22DC5
echo "${{secrets.GPG_PASSPHRASE}}" | /usr/lib/gnupg2/gpg-preset-passphrase --preset "${{secrets.GPG_KEYGRIP}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good for our purposes, but in general it's best to avoid GitHub Action syntax ${{...}} inside bash scripts, and instead assign ${{secrets.*}} values to environment variables and then use those environment variables in the bash script. That approach avoids a whole set of escaping problems when it comes to secret values that may have bash syntax like quotes or $ in them.

We can fix this as subsequent ship.

@samcoe samcoe enabled auto-merge (squash) September 6, 2022 12:52
@samcoe samcoe merged commit 39df244 into trunk Sep 6, 2022
@samcoe samcoe deleted the release-workflow-gpg branch September 6, 2022 12:59
@KoMaR005

This comment was marked as spam.

@KoMaR005

This comment was marked as spam.

@CJBosstonKAJLTE

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants