Skip to content

Commit 9ebc4d4

Browse files
authored
Merge pull request #77 from hatena/update-blogsync-v0.20.1
Update blogsync v0.20.1
2 parents 51715f7 + 6ff3c0d commit 9ebc4d4

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

.github/actions/setup/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
- name: setup blogsync
1111
uses: x-motemen/blogsync@v0
1212
with:
13-
version: v0.18.2
13+
version: v0.20.1
1414
- name: restore mtime
1515
run: |
1616
git restore-mtime

.github/workflows/push-when-publishing-from-draft.yaml

+1-22
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,13 @@ jobs:
3030
with:
3131
files: draft_entries/**/*.md
3232
since_last_remote_commit: true
33-
- name: blogsync push and delete file
33+
- name: blogsync push
3434
id: publised-from-draft
3535
run: |
36-
published_from_draft_edit_urls=()
3736
for file in ${{ steps.changed-draft-files.outputs.all_changed_files }}; do
3837
draft=$(yq --front-matter=extract 'select(.Draft == true)' "$file")
3938
if [[ -z "$draft" ]]; then
4039
blogsync push "$file"
41-
published_from_draft_edit_urls+=($(yq '.EditURL' --front-matter=extract "$file"))
42-
rm "$file"
43-
fi
44-
done
45-
echo "PUBLISHED_FROM_DRSFT_EDIT_URLS=${published_from_draft_edit_urls[@]}" >> $GITHUB_OUTPUT
46-
- name: set blog domain
47-
id: set-domain
48-
run: |
49-
domain="${{ inputs.BLOG_DOMAIN }}"
50-
echo "BLOG_DOMAIN=$(echo $domain | tr -d '\n\r ')" >> "$GITHUB_OUTPUT"
51-
- name: pull
52-
run: |
53-
blogsync pull ${{ steps.set-domain.outputs.BLOG_DOMAIN }}
54-
- name: delete other files
55-
run: |
56-
files=($(git ls-files -o --exclude-standard))
57-
for file in ${files[@]}; do
58-
editurl=$(yq '.EditURL' --front-matter=extract $(echo $file))
59-
if printf '%s\n' "${{ steps.publised-from-draft.outputs.PUBLISHED_FROM_DRSFT_EDIT_URLS }}" | grep -qvx "$editurl"; then
60-
rm "$file"
6140
fi
6241
done
6342
- name: create pull request

0 commit comments

Comments
 (0)