Skip to content

Commit

Permalink
Add OpenGraph definition
Browse files Browse the repository at this point in the history
  • Loading branch information
baierjan committed Jan 11, 2024
1 parent 9acde16 commit 313f943
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
23 changes: 19 additions & 4 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,32 @@ runs:
- run: sudo apt-get install -y kramdown weasyprint imagemagick ghostscript
shell: bash
- name: Render Markdown from configured backlog queries
run: python backlogger/backlogger.py ${{ inputs.config }} ${{ inputs.args }}
run: |
python backlogger/backlogger.py ${{ inputs.config }} ${{ inputs.args }}
if [ "$?" eq 0 ]; then
echo "BACKLOG_STATUS=Green" >> "$GITHUB_ENV"
else
echo "BACKLOG_STATUS=Red" >> "$GITHUB_ENV"
fi
env:
REDMINE_API_KEY: ${{ inputs.REDMINE_API_KEY }}
shell: bash
- name: Render HTML
run: |
mkdir -p ${{ inputs.folder }}
cd ${{ inputs.folder }}
cat ../backlogger/head.html >index.html
kramdown ../index.md >>index.html
sed s@GITHUB_REPOSITORY@${{ github.repository }}@g ../backlogger/foot.html >>index.html
cat ../backlogger/head.html > index.html
kramdown ../index.md >> index.html
cat ../backlogger/foot.html >> index.html
org=${{ github.repository_owner }}
repo=$(cut -f2 -d/ <<<${{ github.repository }})
sed -i \
-e s@GITHUB_REPOSITORY@${{ github.repository }}@g \
-e s@GITHUB_IO_URL@https://$org.github.io/$repo@g \
-e s@WORKFLOW_NAME@${{ github.workflow }}@ \
-e s@LATEST_RUN@$(date)@g \
-e s@OVERALL_STATUS@${{ env.BACKLOG_STATUS }}@g \
index.html
shell: bash
- name: Render PNG preview
run: |
Expand Down
15 changes: 14 additions & 1 deletion head.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<html>
<html prefix="og: https://ogp.me/ns#">
<head>
<title>Backlog Status</title>
<meta charset="UTF-8">
<!-- Facebook / Slack tags -->
<meta property="og:title" content="WORKFLOW_NAME" />
<meta property="og:url" content="https://github.com/GITHUB_REPOSITORY" />
<meta property="og:image" content="GITHUB_IO_URL/preview.png" />
<!-- Twitter / Slack tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="WORKFLOW_NAME" />
<meta name="twitter:image" content="GITHUB_IO_URL/preview.png" />
<meta name="twitter:url" content="https://github.com/GITHUB_REPOSITORY" />
<meta name="twitter:label1" content="Latest run" />
<meta name="twitter:data1" content="LATEST_RUN" />
<meta name="twitter:label2" content="Overall status" />
<meta name="twitter:data1" content="OVERALL_STATUS" />
<style>
body {
font-family: Verdana, Arial;
Expand Down

0 comments on commit 313f943

Please sign in to comment.