Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/close_specific_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
run: |
PR_TITLE=$(jq -r ".pull_request.title" $GITHUB_EVENT_PATH)
echo "PR_TITLE: $PR_TITLE"
# 检查标题是否符合 Conventional Commits 格式中的 feat 或 fix (不区分大小写)
if printf '%s\n' "$PR_TITLE" | grep -Eiq '(^|[[:space:]])(feat|fix)(\([^)]+\))?(!)?:'; then
echo "PR title contains feat or fix, skipping auto-close."
exit 0
fi
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body '${{ env.comment }}'
gh pr close ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
env:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/download_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ on:
- 是 | 本子维度合并pdf
- 是 | 章节维度合并pdf

PDF_NAME_RULE:
type: string
description: 'PDF文件命名规则。支持字段如 Aid, Atitle, Pindex, Pid, Ptitle'
default: ''
required: false

ZIP_NAME:
type: string
default: 本子.tar.gz
Expand Down Expand Up @@ -78,6 +84,7 @@ jobs:
UPLOAD_NAME: ${{ github.event.inputs.UPLOAD_NAME }}
IMAGE_SUFFIX: ${{ github.event.inputs.IMAGE_SUFFIX }}
PDF_OPTION: ${{ github.event.inputs.PDF_OPTION }}
PDF_NAME_RULE: ${{ github.event.inputs.PDF_NAME_RULE }}

# 登录相关secrets
JM_USERNAME: ${{ secrets.JM_USERNAME }}
Expand Down
10 changes: 9 additions & 1 deletion usage/workflow_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,19 @@ def cover_option_config(option: JmOption):
pdf_option = env('PDF_OPTION', None)
if pdf_option and pdf_option != '否':
call_when = 'after_album' if pdf_option == '是 | 本子维度合并pdf' else 'after_photo'

pdf_name_rule = env('PDF_NAME_RULE', None)
if isinstance(pdf_name_rule, str):
pdf_name_rule = pdf_name_rule.strip()

if not pdf_name_rule:
pdf_name_rule = '[JM{Aid}] {Atitle}' if call_when == 'after_album' else '[JM{Aid}] 第{Pindex}章-JM{Pid}-{Ptitle}'

Comment thread
coderabbitai[bot] marked this conversation as resolved.
plugin = [{
'plugin': Img2pdfPlugin.plugin_key,
'kwargs': {
'pdf_dir': option.dir_rule.base_dir + '/pdf/',
'filename_rule': call_when[6].upper() + 'id',
'filename_rule': pdf_name_rule,
'delete_original_file': True,
}
}]
Expand Down
Loading