Skip to content

Instantly share code, notes, and snippets.

@pelletier
Last active April 5, 2021 19:11
Show Gist options
  • Save pelletier/dc2708d769f2225c7f3c033050e1ff18 to your computer and use it in GitHub Desktop.
Save pelletier/dc2708d769f2225c7f3c033050e1ff18 to your computer and use it in GitHub Desktop.
Emacs forge Github store API token with Secret Service

Here is one way to use Magit's Forge feature with GitHub, storing the API token in Access Service.

Create token

https://github.com/settings/tokens

Permissions suggested by the official documentation: read:org repo user.

Install forge with secrets

In .emacs:

(use-package secrets
  :config
  (setq auth-sources '("secrets:Login")))

(use-package forge
  :after magit secrets)

(Login can be replaced with the collection of your choice)

Create the password in Secret Service

Eval in scratch (replace UPPERCASED values accordingly):

(secrets-create-item "Login" "Emacs Forge Github" "YOUR API TOKEN" :host "api.github.com" :user "USERNAME^forge")

Add repository in Magit

C-x g, ', a

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