Skip to content

Commit

Permalink
Update create-article-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yknz authored Sep 4, 2024
1 parent ad3854c commit b193f03
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/create-article-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,16 @@ jobs:

- name: Update author
run: ls -rt source/_posts | tail -n 1 | xargs -I {} python3 -m matteredit update source/_posts/{} --params author=${{ github.event.client_payload.author }}

- uses: actions/github-script@v6
id: is_null
with:
script: return ${{ github.event.client_payload.thumbnail_url }} === null

- name: Get thumbnail filepath
id: thumbnail-filepath
if: ${{ github.event.client_payload.thumbnail_url }} != null
if: ${{ github.event.client_payload.thumbnail_url }} != ''
run: |
thumbnailpath=`ls -rt source/_posts | tail -n 1 | xargs -I {} python3 -m matteredit show source/_posts/{} --param thumbnail | sed -e 's/^/\source/g'`
echo "thumbnailpath=$thumbnailpath" >> $GITHUB_OUTPUT
- name: Download thumbnail
if: ${{ github.event.client_payload.thumbnail_url }} != null
if: ${{ github.event.client_payload.thumbnail_url }} != ''
run: |
wget ${{ github.event.client_payload.thumbnail_url }} -O ${{ steps.thumbnail-filepath.outputs.thumbnailpath }}
Expand Down

0 comments on commit b193f03

Please sign in to comment.