Skip to content

Commit

Permalink
Merge pull request #109 from zetxek/fix/post-summary-meta
Browse files Browse the repository at this point in the history
Fix/post summary meta
  • Loading branch information
zetxek authored Dec 22, 2024
2 parents 42b45e7 + c5bca90 commit 98425e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/update-demo-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
update:
update-demo:
env:
SOURCE_BRANCH_NAME: ${{ github.head_ref || github.ref_name }} # PR branch name
PR_NUMBER: ${{ github.event.number }}
Expand Down Expand Up @@ -114,9 +114,10 @@ jobs:
echo "Logging in to GitHub CLI."
gh auth login --with-token < token.txt
# Check if the PR already exists
PR_EXISTS=$(gh pr list --state open --base $BASE_BRANCH --head $BRANCH_NAME --json number | jq '.[0].number')
# If the PR exists, update it
# Check if the PR already exists - if there's no "number" returned, we default to empty string
PR_EXISTS=$(gh pr list --state open --base $BASE_BRANCH --head $BRANCH_NAME --json number | jq '.[0].number // empty')
echo "PR_EXISTS: $PR_EXISTS"
# Check if there's a PR number. If the PR exists, update it (empty = it doesn't exist)
if [ -n "$PR_EXISTS" ]; then
echo "PR Exists. Updating pull-request..."
gh pr view
Expand All @@ -125,7 +126,7 @@ jobs:
# Else, we create it
else
echo "Creating pull-request..."
echo "✨PR Does not exist yet. Creating pull-request..."
PR_TITLE='preview: update theme to `'$SOURCE_BRANCH_NAME'`'
echo 'PR title: '$PR_TITLE
PR_BODY="⚠️ The source PR is not merged yet - this is a preview PR.
Expand Down
2 changes: 1 addition & 1 deletion layouts/blog/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
<div>
<section>
{{ i18n "published_on" }}
<h4 id="date">{{ .Date.Format "Mon Jan 2, 2006" }}</h4>
<h4 id="date">{{ .Date.Format "Mon Jan 2, 2006" }}</h4> ·
<h4 id="wordcount">{{ .WordCount }} Words</h4>
</section>
{{ with .GetTerms "topics" }}
Expand Down

0 comments on commit 98425e6

Please sign in to comment.