From 2df61f1bf0ae65b4247f5dbddb348199ad12f940 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 9 Nov 2025 23:50:40 +0000 Subject: Support GITHUB_SHA for creating permalinks --- pydis_core/exts/source.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pydis_core/exts/source.py b/pydis_core/exts/source.py index 32c0f0a5..5fe29306 100644 --- a/pydis_core/exts/source.py +++ b/pydis_core/exts/source.py @@ -1,6 +1,7 @@ """Pre-built cog to display source code links for commands and cogs.""" import enum import inspect +import os from importlib import metadata from pathlib import Path from typing import NamedTuple, TYPE_CHECKING @@ -160,6 +161,8 @@ class SourceCode(commands.Cog, description="Displays information about the bot's if source_type == _SourceType.core_command or source_type == _SourceType.core_cog: version = f"v{metadata.version('pydis_core')}" + elif sha := os.getenv("GITHUB_SHA"): + version = sha else: version = "main" -- cgit v1.2.3