From 95f3a9618466aab46ef29177395600f790d12fa8 Mon Sep 17 00:00:00 2001 From: Rene Schallner Date: Mon, 22 May 2023 02:46:54 +0200 Subject: [PATCH] replaced gitpython by git subcommand in workflow --- .github/workflows/release.yml | 3 ++- tools/announceybot/announceybot.py | 12 ++++++++---- tools/announceybot/generate_releasenotes.py | 11 ++++++++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e7bde4..9ef06c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,13 +21,14 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install discord-webhook GitPython + pip install discord-webhook - name: Set tag name id: tag run: | echo "::set-output name=version::${GITHUB_REF#refs/tags/}" + # we don't build it, we provide it in ./tools # - uses: goto-bus-stop/setup-zig@v2 # with: # version: master diff --git a/tools/announceybot/announceybot.py b/tools/announceybot/announceybot.py index ef14f1e..d57d84d 100644 --- a/tools/announceybot/announceybot.py +++ b/tools/announceybot/announceybot.py @@ -1,7 +1,6 @@ import sys import os from discord_webhook import DiscordWebhook -from git import Repo import subprocess URL = os.getenv("WEBHOOK_URL") @@ -18,9 +17,14 @@ def send_to_discord(message): def get_tag_annotation(tagname): - repo = Repo('.') - tag = repo.tags[tagname] - return tag.tag.message + ret = subprocess.run([ + "git", + "-l", + "--format='%(contents)'", + f"{TAG_NAME}", + ], capture_output=True) + text = ret.stdout.decode("utf-8") + return text def get_replacement(): diff --git a/tools/announceybot/generate_releasenotes.py b/tools/announceybot/generate_releasenotes.py index a725c3b..2125a9f 100644 --- a/tools/announceybot/generate_releasenotes.py +++ b/tools/announceybot/generate_releasenotes.py @@ -7,9 +7,14 @@ TAG_NAME = os.getenv("TAG_NAME", sys.argv[1]) def get_tag_annotation(tagname): - repo = Repo('.') - tag = repo.tags[tagname] - return tag.tag.message + ret = subprocess.run([ + "git", + "-l", + "--format='%(contents)'", + f"{TAG_NAME}", + ], capture_output=True) + text = ret.stdout.decode("utf-8") + return text def get_replacement():