Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Try to prevent additional issues with writing the changelogs to file (#1815)

Zack Krida644b3b1a72ab
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 21a6160ad..5c5b2a34a 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -109,10 +109,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add new changelog file to documentation
- run: |
- file="documentation/changelogs/${{ inputs.app }}/${{ steps.tag.outputs.date }}.md"
- echo -e "# ${{ steps.tag.outputs.date }}\n\n" > "$file"
- echo -e '${{ steps.release-drafter.outputs.body }}' >> "$file"
+ env:
+ APP: ${{ inputs.app }}
+ DATE: ${{ steps.tag.outputs.date }}
+ RELEASE_BODY: ${{ steps.release-drafter.outputs.body }}
+ working-directory: automations/python/workflows
+ run: python write_changelog.py
- name: Setup CI env
uses: ./.github/actions/setup-env
diff --git a/automations/python/workflows/write_changelog.py b/automations/python/workflows/write_changelog.py
new file mode 100644
index 000000000..fce9c25cb
--- /dev/null
+++ b/automations/python/workflows/write_changelog.py
@@ -0,0 +1,16 @@
+import os
+from pathlib import Path
+
+
+app = os.environ["APP"]
+tag_date = os.environ["DATE"]
+release_body = os.environ["RELEASE_BODY"]
+
+file_path = Path(__file__).parents[3] / f"documentation/changelogs/{app}/{tag_date}.md"
+file_path.write_text(
+ """
+ # {tag_date}
+
+ {release_body}
+ """
+)