diff --git a/.github/workflows/update-demo-pr.yml b/.github/workflows/update-demo-pr.yml index da7f495..f3d5d83 100644 --- a/.github/workflows/update-demo-pr.yml +++ b/.github/workflows/update-demo-pr.yml @@ -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 }} @@ -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 @@ -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. diff --git a/layouts/blog/summary.html b/layouts/blog/summary.html index b87b972..04cd353 100644 --- a/layouts/blog/summary.html +++ b/layouts/blog/summary.html @@ -5,7 +5,7 @@

{{ .Title }}

{{ i18n "published_on" }} -

{{ .Date.Format "Mon Jan 2, 2006" }}

+

{{ .Date.Format "Mon Jan 2, 2006" }}

·

{{ .WordCount }} Words

{{ with .GetTerms "topics" }}