-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: Add support for GitHub API commit #2046
Conversation
@olblak Leaving this in draft for now as I am still doing some testing in our organization, but happy to get any feedback. I'll see if I can get some tests in as well when I get some more time. |
a34eb57
to
0686bc6
Compare
Spelling issues can be ignored by adding them to https://github.com/updatecli/updatecli/blob/main/.github/actions/spelling/allow.txt |
This commit adds support for GitHub API commit. It allows to update a file in a GitHub repository using the GitHub API instead of using git. The GitHub API commit is useful when a user is using the automated token from Github Actions as it creates a signed commit automatically.
4b05bdd
to
008d116
Compare
Added a pattern to remove spellcheck on lines where it didn't make sense which was a bit easier than having to add exclusions for base64 strings. 😄 |
008d116
to
3d63f8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pullrequest, it looks great.
I didn't test it yet, but I am planning to release a new release candidate 0.76.0-rc.2 so we can see how it behaves during a few days
Fix #1914
This pull request adds support for GitHub API commit. It allows Github SCM to commit a file in a GitHub repository using the GitHub API instead of using native Git.
The GitHub commit API is useful when a user is using the automated token from Github Actions as it creates a signed commit automatically, removing the requirement of using a bot account with a GPG key configured.
For now I've hidden this feature behind the
commitUsingApi
(not loving the parameter name, happy for suggestions).In addition I changed the Github pull request action to check if working branch is ahead using the API instead of relying on the native Git handler as I kept running in to issues where Github Actions wasn't recognizing changes done (not exactly sure why, but I think this will 100% ensure that the commit is available in Github).
As can be seen in the below screenshot, the commit is shown as verified with the Github Actions bot user committing the changes.
Test
Build my fork and use the Github SCM with
commitUsingApi: true
.