Skip to content
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

Add Signing To Commit Function #563

Merged
merged 4 commits into from
Mar 11, 2022
Merged

Conversation

hi-artem
Copy link
Contributor

@hi-artem hi-artem commented Mar 10, 2022

Add gpg signing

Fix #274

Add ability to specify gpg key and passphrase to sign commits. No passphrase will be treated as empty passphrase.

Test

Tested manually with this config for scm:

scms:
  default:
    kind: github
    spec:
      user: "{{ .github.user }}"
      email: "{{ .github.email }}"
      owner: "{{ .github.owner }}"
      repository: "{{ .github.repository }}"
      token: "{{ requiredEnv .github.token }}"
      username: "{{ .github.username }}"
      branch: "{{ .github.branch }}"
      gpg:
        signingKey: |
          -----BEGIN PGP PRIVATE KEY BLOCK-----

          Blablabla... this is secret
          -----END PGP PRIVATE KEY BLOCK-----
        enabled: true

Also, added a new test for sign package:

cd updatecli/pkg/plugins/scms/git/sign
go test

Additional Information

Tradeoff

Potential improvement

Any feedback is welcome. I am not familiar with the tool project structure, so if there is a need to change anything in the PR it is cool with me. I am motivated to get it merged.

@olblak
Copy link
Member

olblak commented Mar 10, 2022

I wanted to work on this for a quite long time, thanks very much.

@olblak
Copy link
Member

olblak commented Mar 10, 2022

The pullrquest looks very good, I'll need some time tomorrow to do additionnal testing

@hi-artem
Copy link
Contributor Author

@olblak Thank you for reviewing my PR! Looking forward to the testing results.

@olblak olblak self-assigned this Mar 11, 2022
@olblak olblak added the enhancement New feature or request label Mar 11, 2022
@olblak
Copy link
Member

olblak commented Mar 11, 2022

I confirmed that I successfully manage to sign commits \o/

@olblak olblak enabled auto-merge (squash) March 11, 2022 15:15
@olblak olblak merged commit 5182723 into updatecli:main Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to automatically sign commits
2 participants