Skip to content

Commit

Permalink
Revert "Bot for Changelog (#833)"
Browse files Browse the repository at this point in the history
This reverts commit 6d0780d.
  • Loading branch information
Mnemotechnician committed Sep 6, 2024
1 parent e553e68 commit 391cb06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
CHANGELOG_DIR: ${{ vars.CHANGELOG_DIR }}
PR_NUMBER: ${{ github.event.number }}
CHANGELOG_WEBHOOK: ${{ secrets.CHANGELOG_WEBHOOK }}

jobs:
changelog:
Expand Down Expand Up @@ -55,7 +54,3 @@ jobs:
git push
shell: bash
continue-on-error: true

- name: Publish changelog
run: Tools/actions_changelogs_since_last_run.py
continue-on-error: true
10 changes: 4 additions & 6 deletions Tools/actions_changelogs_since_last_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
GITHUB_REPOSITORY = os.environ["GITHUB_REPOSITORY"]
GITHUB_RUN = os.environ["GITHUB_RUN_ID"]
GITHUB_TOKEN = os.environ["GITHUB_TOKEN"]
CHANGELOG_DIR = os.environ["CHANGELOG_DIR"]
CHANGELOG_WEBHOOK = os.environ["CHANGELOG_WEBHOOK"]
PR_NUMBER = os.environ["PR_NUMBER"]

# https://discord.com/developers/docs/resources/webhook
DISCORD_SPLIT_LIMIT = 2000
DISCORD_WEBHOOK_URL = os.environ.get("DISCORD_WEBHOOK_URL")

TYPES_TO_EMOJI = {
"Fix": "🐛",
Expand All @@ -33,7 +31,7 @@
ChangelogEntry = dict[str, Any]

def main():
if not CHANGELOG_WEBHOOK:
if not DISCORD_WEBHOOK_URL:
return

session = requests.Session()
Expand Down Expand Up @@ -134,12 +132,12 @@ def get_discord_body(content: str):
def send_discord(content: str):
body = get_discord_body(content)

response = requests.post(CHANGELOG_WEBHOOK, json=body)
response = requests.post(DISCORD_WEBHOOK_URL, json=body)
response.raise_for_status()


def send_to_discord(entries: Iterable[ChangelogEntry]) -> None:
if not CHANGELOG_WEBHOOK:
if not DISCORD_WEBHOOK_URL:
print(f"No discord webhook URL found, skipping discord send")
return

Expand Down

0 comments on commit 391cb06

Please sign in to comment.