Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
yknz committed Sep 23, 2024
1 parent 14a85e9 commit 191819e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/create-article-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ jobs:
- name: Download & Update thumbnail
if: ${{ github.event.client_payload.thumbnail_url != '' }}
run: |
curl -JLO -w '%{filename_effective}' "${{ github.event.client_payload.thumbnail_url }}"
articlefilepath=`ls -rt source/_posts | tail -n 1 | xargs -I {} echo source/_posts/{}`
thumbnailpath=`python3 -m matteredit show $articlefilepath --param thumbnail | sed -e 's/^/\source/g'`
filename=`curl -JLO -w '%{filename_effective}' "${{ github.event.client_payload.thumbnail_url }}" | grep filename | sed "s/^.*'\(.*\)'.*$/\1/"`
rm $thumbnailpath
newthumbnailpath="${thumbnailpath%.*}.${filename##*.}"
mv $filename $newthumbnailpath
echo $newthumbnailpath | sed -e 's/source//g' | xargs -I {} python3 -m matteredit update $articlefilepath --params thumbnail={}
- name: Get article title
id: get-article-title
Expand Down

0 comments on commit 191819e

Please sign in to comment.