0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 12:09:27 +08:00
discourse/plugins/discourse-github
Renato Atilio 37134e5659
FIX: Refresh GitHub PR onebox status for URL variants (#41878)
The PR status webhook only knows the canonical PR URL, but posts can
link the PR in forms the onebox engine also accepts: with a path suffix
(/changes, /files), query, fragment, http scheme, or www host. Oneboxes
are cached per exact URL (and full oneboxes under the normalized
encoding), so invalidating only the canonical URL left every other
variant stale. The rebake then re-cooked the old status straight from
cache and the icon never updated.

Match links with an anchored, scheme/host-tolerant pattern and
invalidate the exact URLs stored in TopicLink/Chat::MessageLink (plus
their normalized encodings), so whichever variant a post used gets a
fresh fetch on rebake. The anchoring also stops a webhook for `/pull/12`
from rebaking posts for `/pull/123`, which the old prefix match did.
2026-07-21 20:03:12 -03:00
..
app FIX: Refresh GitHub PR onebox status for URL variants (#41878) 2026-07-21 20:03:12 -03:00
assets FEATURE: Add PR status icon to inline oneboxes (#39649) 2026-05-04 18:15:14 +02:00
config I18N: Update translations (#41762) 2026-07-16 11:06:03 +02:00
db/migrate
spec FIX: Refresh GitHub PR onebox status for URL variants (#41878) 2026-07-21 20:03:12 -03:00
package.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00
plugin.rb FEATURE: Route all GitHub API requests through one rate-limited client (#40637) 2026-06-15 10:59:10 +02:00
README.md
tsconfig.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00

Discourse Github

https://meta.discourse.org/t/discourse-github/99895/

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

Installation

Follow the plugin installation guide.

Github Badges

Assign badges to your users based on GitHub contributions.

How to use:

  1. Enable github badges enabled in Settings -> Plugins.

  2. Generate an access token on Github. Be sure to give it only the public_repo scope. Paste that token into the github linkback access token setting.

  3. Add URL of the GitHub repo to scan for contributions to the github badges repo 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 an access token on Github. Be sure to give it only the public_repo scope. Paste that token into the github linkback access token setting.

  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

Replace Github non-permalinks with permalinks.

How to use:

  1. Enable github permalinks enabled in Settings -> Plugins.
  2. If you want to exclude certain files or directories from permalink overwrites, you can modify that in the github permalinks exclude site setting in the following formats:
    • filename links to all files with matching filename
    • username/* links to all repositories belonging to the user/organization
    • username/repository/* links to any file in the repository
    • username/repository/directory/* links to any file in the directory within repository
    • username/repository/file.rb a specific file