Discourse GitHub

Summary: This plugin combines functionality of deprecated github_badges and discourse-github-linkback plugins.

:link: GitHub: GitHub - discourse/discourse-github
:arrow_right: Install: Follow the plugin installation guide.

Features

Github Badges

Assign badges to your users based on GitHub contributions.

How to use:
  1. Enable github badges enabled in Settings -> Plugins.
  2. Generate a GitHub access token and paste it into the github linkback access token setting. See below for instructions.
  3. Add one or more URLs of the GitHub repos to scan for contributions to the github badges repos site setting.

Github Linkback

Create a link from a Github pull request or commit back to a Discourse post where it is mentioned.

How to use:
  1. Enable github linkback enabled in Settings -> Plugins.
  2. Generate a GitHub access token and paste it into the github linkback access token setting. See below for instructions.
  3. Finally, add the projects you wish to post to in the github linkback projects site setting in the formats:
    • username/repository for specific repositories
    • username/* for all repositories of a certain user

Github Permalink

Replace Github non-permalinks with permalinks.

How to use:
  1. Enable github permalinks enabled in Settings -> Plugins.

Configuration

GitHub Access Token

In order for the linkback feature to work and the badges to be granted to your users, you need to provide a Github access token. You can generate your token here: https://github.com/settings/tokens/new.

The linkback feature requires the public_repo scope, and granting badges requires no scope (leave everything unchecked if you only want badges). Since the public_repo scope grants write access to repositories, we recommend you create a throwaway Github account that has access to no repositories and use it just to generate a token.

CHANGELOG

TODO

22 Likes

Hey team, the public_repo scope says it is for public repos only. Does it mean the linkback won’t work for private repos?

I believe it also works for private repos, can you test it after all the configuration and see if you hit any issues?

1 Like

I haven’t tested the feature to know myself, but you’d have to grant repo rights (vs. just public_repo) to get access to private repositories for that to work.

2 Likes

Do you mean the “full control of private repos” scope?

I find it confusing that public_repo is a sub-item of the repo.

Also, if the token does not grant the permission required, should not it log some error? It currently does not work, but it does so silently with no errors/warnings in the log.