Skip to content

Commit e9c8196

Browse files
committed
push-when-publishing-from-draftの不要な処理を削除
1 parent 51715f7 commit e9c8196

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

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

Lines changed: 1 addition & 22 deletions
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)