Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(changelog): post to Slack instead of GitHub releases, clean up scope

Jake Hulberg235df51ebac3
diff --git a/.github/resources/changelog-generator.py b/.github/resources/changelog-generator.py
index 7247f6aadf..172c862f1f 100644
--- a/.github/resources/changelog-generator.py
+++ b/.github/resources/changelog-generator.py
@@ -1,18 +1,19 @@
#!/usr/bin/env python3
# inspired by https://www.photoroom.com/inside-photoroom/how-we-automated-our-changelog-thanks-to-chatgpt
import os
-import requests
import re
import subprocess
-from datetime import datetime
-import uuid
import sys
+from datetime import datetime
+
+import requests
# Constants
REPO_OWNER = "infisical"
REPO_NAME = "infisical"
TOKEN = os.environ.get("GITHUB_TOKEN")
OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY")
+SLACK_WEBHOOK_URL = os.environ.get("SLACK_WEBHOOK_URL")
DRY_RUN = os.environ.get("DRY_RUN", "false").lower() == "true"
MODEL = os.environ.get("MODEL", "anthropic/claude-haiku-4.5")
@@ -28,12 +29,17 @@ if TOKEN:
headers["Authorization"] = f"Bearer {TOKEN}"
-def set_multiline_output(name, value):
- with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
- delimiter = uuid.uuid1()
- print(f'{name}<<{delimiter}', file=fh)
- print(value, file=fh)
- print(delimiter, file=fh)
+def post_to_slack(tag, changelog):
+ if not SLACK_WEBHOOK_URL:
+ print("Error: SLACK_WEBHOOK_URL is required", file=sys.stderr)
+ sys.exit(1)
+
+ message = f"*Changelog for {tag}*\n\n{changelog}"
+ response = requests.post(SLACK_WEBHOOK_URL, json={"text": message})
+
+ if response.status_code != 200:
+ raise Exception(f"Error posting to Slack: {response.status_code} - {response.text}")
+
def find_previous_release_tag(release_tag:str):
# Find the previous stable release tag, excluding nightly tags
@@ -243,10 +249,9 @@ if __name__ == "__main__":
print("=" * 60)
print(changelog)
print("=" * 60)
+ post_to_slack(f"[DRY RUN] {latest_tag}", changelog)
else:
- # Output for GitHub Actions
- if os.environ.get('GITHUB_OUTPUT'):
- set_multiline_output("changelog", changelog)
+ post_to_slack(latest_tag, changelog)
except Exception as e:
print(f"Error: {str(e)}", file=sys.stderr)
diff --git a/.github/workflows/generate-github-release.yml b/.github/workflows/generate-github-release.yml
deleted file mode 100644
index b7ba9c9662..0000000000
--- a/.github/workflows/generate-github-release.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-name: Generate Categorized GitHub Release
-
-permissions:
- contents: write
-
-on:
- workflow_dispatch:
- inputs:
- tag:
- description: "Release tag (e.g. v0.158.7). Required for manual triggers."
- required: true
- type: string
- draft:
- description: "Create as draft (for testing)"
- required: false
- type: boolean
- default: false
- push:
- tags:
- # Generate changelogs for all stable releases
- - "v*.*.*"
- # Exclude nightly tags to prevent them from being treated as stable releases
- - "!v*.*.*-nightly-*"
-
-jobs:
- generate-release:
- runs-on: ubuntu-latest
- env:
- RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }}
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- fetch-tags: true
- fetch-depth: 0
-
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: "3.12"
-
- - name: Install dependencies
- run: |
- python -m pip install --upgrade pip
- pip install requests
-
- - name: Generate categorized changelog
- id: changelog
- run: python .github/resources/changelog-generator.py
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
- RELEASE_TAG: ${{ env.RELEASE_TAG }}
-
- - name: Create GitHub Release
- uses: softprops/action-gh-release@v2
- with:
- tag_name: ${{ env.RELEASE_TAG }}
- name: ${{ env.RELEASE_TAG }}
- body: ${{ steps.changelog.outputs.changelog }}
- draft: ${{ github.event.inputs.draft == 'true' || false }}
- prerelease: false
- make_latest: true
diff --git a/.github/workflows/generate-release-changelog.yml b/.github/workflows/generate-release-changelog.yml
index c23a55cd83..b801c54d7b 100644
--- a/.github/workflows/generate-release-changelog.yml
+++ b/.github/workflows/generate-release-changelog.yml
@@ -1,9 +1,11 @@
name: Generate Changelog
-permissions:
- contents: write
on:
workflow_dispatch:
+ inputs:
+ release_tag:
+ description: "Release tag to generate changelog for (e.g. infisical/v0.159.25). Defaults to latest tag if omitted."
+ required: false
push:
tags:
- "infisical/v*.*.*"
@@ -31,3 +33,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_2 }}
+ RELEASE_TAG: ${{ github.event.inputs.release_tag }}
diff --git a/.github/workflows/nightly-tag-generation.yml b/.github/workflows/nightly-tag-generation.yml
index 8318b4e76d..ff15b61d8f 100644
--- a/.github/workflows/nightly-tag-generation.yml
+++ b/.github/workflows/nightly-tag-generation.yml
@@ -1,13 +1,7 @@
name: Generate Nightly Tag
on:
- workflow_dispatch:
- inputs:
- draft:
- description: "Create as draft (for testing)"
- required: false
- type: boolean
- default: false
+ workflow_dispatch: # Allow manual triggering for testing
permissions:
contents: write
@@ -21,7 +15,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for tags
- fetch-tags: true
token: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }}
- name: Configure Git
@@ -87,43 +80,12 @@ jobs:
git push origin "$NIGHTLY_TAG"
echo "✅ Created and pushed nightly tag: $NIGHTLY_TAG"
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: "3.12"
-
- - name: Install Python dependencies
- run: |
- python -m pip install --upgrade pip
- pip install requests
-
- - name: Generate categorized changelog
- id: changelog
- continue-on-error: true
- run: python .github/resources/changelog-generator.py
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
-
- - name: Create GitHub Release (categorized)
- if: steps.changelog.outcome == 'success' && steps.changelog.outputs.changelog
- uses: softprops/action-gh-release@v2
- with:
- tag_name: ${{ env.NIGHTLY_TAG }}
- name: ${{ env.NIGHTLY_TAG }}
- body: ${{ steps.changelog.outputs.changelog }}
- draft: ${{ github.event.inputs.draft == 'true' || false }}
- prerelease: true
- make_latest: false
-
- # Fallback to GitHub's auto-generated notes if changelog generation fails
- - name: Create GitHub Release (fallback)
- if: steps.changelog.outcome != 'success' || !steps.changelog.outputs.changelog
+ - name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.NIGHTLY_TAG }}
name: ${{ env.NIGHTLY_TAG }}
- draft: ${{ github.event.inputs.draft == 'true' || false }}
+ draft: false
prerelease: true
generate_release_notes: true
make_latest: false