Skip to content

Commit

Permalink
feat: content of about page now generated based on information from R…
Browse files Browse the repository at this point in the history
…EADME.md
  • Loading branch information
grigoriev committed Jun 24, 2024
1 parent 9c6b2b0 commit e1ea1d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 3 additions & 16 deletions .scripts/convert-readme.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit e1ea1d9

Please sign in to comment.