Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit ff489380 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

Merge pull request #8659 from wmontwe/fix-render-notes

Change url from raw to api to retrieve the release notes
parent 4c0b7b63
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -786,7 +786,7 @@ jobs:
          mkdir whatsnew
          if [[ "$RELEASE_TYPE" = "beta" || "$RELEASE_TYPE" = "release" ]]; then
            FILEPATH=app-metadata/${APPLICATION_ID}/en-US/changelogs/${VERSION_CODE}.txt
            wget -O whatsnew/whatsnew-en-US https://raw.githubusercontent.com/${REPO}/${APP_SHA}/${FILEPATH}?token=$(date +%s)
            wget --header="Accept: application/vnd.github.v3.raw" -O whatsnew/whatsnew-en-US https://api.github.com/repos/${REPO}/contents/${FILEPATH}?ref=${APP_SHA}
          elif [[ "$RELEASE_TYPE" = "daily" ]]; then
            COMMIT_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
            WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
+7 −8
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ import argparse
import os
import requests
import yaml
import time
import sys

from jinja2 import Template
@@ -40,16 +39,16 @@ def render_notes(
    else:
        tb_notes_url = (
            os.path.join(
                f"https://raw.githubusercontent.com/{notesrepo}/",
                f"refs/heads/{notesbranch}",
                tb_notes_directory,
                tb_notes_filename,
                f"https://api.github.com/repos/{notesrepo}/",
                f"contents/{tb_notes_directory}/{tb_notes_filename}?ref={notesbranch}",
            )
            + "?token="
            + str(int(time.time()))
        )

        response = requests.get(tb_notes_url)
        headers = {
            "Accept": "application/vnd.github.v3.raw"
        }

        response = requests.get(tb_notes_url, headers=headers)
        response.raise_for_status()
        yaml_content = yaml.safe_load(response.text)

+4 −0
Original line number Diff line number Diff line
PyNaCl
PyYAML
Jinja2
requests