name: Publish to Confluence on: push: branches: [ master ] # paths: # - '**' # - '!.gitignore' # - '!README.md' # workflow_dispatch: # 允许手动触发工作流 # schedule: # # 每天晚六点十分执行一次 # - cron: '10 10 * * *' env: SEPARATOR: "," # 定义多文件分割符 START_PREFIX: "/g' $temp_path # path 替换 # sed -i -E 's/(.*\!\[.*\]\([ \t]*([a-zA-Z]\:)?(\.*(\/|\\))?([^:\r\n\t\!]*\.[a-zA-Z]+)[ \t]*\))([ ]*<\!\-\-[ \t]*width=[0-9]*[ \t]*\-\->)*/\1/g' $temp_path # url 替换 sed -i -E 's/(.*\!\[.*\]\([ \t]*(http(s)?:\/\/)([^:\r\n\t\!]*(\.[a-zA-Z]+)?)[ \t]*\))([ ]*<\!\-\-[ \t]*width=[0-9]*[ \t]*\-\->)*/\1/g' $temp_path # 标题添加锚点 sed -i -E 's/([#]+[ ]+)(.*)/\1\2 :anchor(\2):/g' $temp_path sed -i -E "s@(\[.*\])(\(#)(.*)(\))@\1\2id-$(echo $temp_filename | tr -d '-')-\3\4@g" $temp_path # 构建及发布 mark --ci --debug --trace --include-path $(pwd) -p $MARK_PASS -b $MARK_URL -f $temp_path || exit 1; else echo "$temp_path not config metadata info, ignore file" fi done