From e1ea1d9d519b10f731f7cfc9d51b67b54a90dc3b Mon Sep 17 00:00:00 2001 From: Sergey Grigoriev Date: Mon, 24 Jun 2024 19:00:46 +0200 Subject: [PATCH] feat: content of about page now generated based on information from README.md --- .github/workflows/maven-release.yml | 6 ------ .scripts/convert-readme.sh | 19 +++---------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index da2e1ba..443ba4f 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -56,14 +56,8 @@ jobs: ] - name: Print settings.xml run: cat /home/runner/.m2/settings.xml - - name: Test Run of convert-readme.sh - run: .scripts/convert-readme.sh - env: - GITHUB_TOKEN: ${{ github.token }} - name: Build with Maven run: mvn --batch-mode -DwpExporterImpl=docker clean package -P tests-with-weasyprint-docker - env: - GITHUB_TOKEN: ${{ github.token }} - name: Extract artefact version id: artefact_version run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT diff --git a/.scripts/convert-readme.sh b/.scripts/convert-readme.sh index 82fe116..a3e1e20 100755 --- a/.scripts/convert-readme.sh +++ b/.scripts/convert-readme.sh @@ -1,28 +1,15 @@ -#!/bin/bash -xv +#!/bin/bash -INPUT_FILE=$1 -OUTPUT_FILE=$2 - -INPUT_FILE="${INPUT_FILE:-README.md}" -OUTPUT_FILE="${OUTPUT_FILE:-README.html}" +INPUT_FILE="${1:-README.md}" +OUTPUT_FILE="${2:-README.html}" # Convert the markdown file to a JSON payload jq -R -s '{"mode": "gfm", "text": .}' < "$INPUT_FILE" > payload.json -echo "GITHUB_TOKEN = $GITHUB_TOKEN" - -# Check if GITHUB_TOKEN is set -if [[ -n "$GITHUB_TOKEN" ]]; then - AUTH_HEADER="Authorization: Bearer $GITHUB_TOKEN" -else - AUTH_HEADER="" -fi - # Send the JSON payload to the GitHub API curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ - ${AUTH_HEADER:+-H "$AUTH_HEADER"} \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/markdown \ -d @payload.json > "$OUTPUT_FILE"