From 92cff093bb4ddced9ccc9727899f07e0e674fcdd Mon Sep 17 00:00:00 2001 From: LIRUI <298977887@qq.com> Date: Tue, 29 Oct 2024 00:29:36 +0800 Subject: [PATCH] 1028.yml --- .github/workflows/发布wordpress文章.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/发布wordpress文章.yml b/.github/workflows/发布wordpress文章.yml index 91a01ea..0df90a3 100644 --- a/.github/workflows/发布wordpress文章.yml +++ b/.github/workflows/发布wordpress文章.yml @@ -46,27 +46,27 @@ jobs: WORDPRESS_PASSWORD: ${{ secrets.WORDPRESS_PASSWORD }} POST_ID: 829 POST_STATUS: "draft" - wp_content: ${{ env.wp_content }} - firmware_version: ${{ env.firmware_version }} run: | FORMATTED_TIME=$(TZ='Asia/Shanghai' date "+%Y年%m月%d日") - # 创建 JSON 数据内容,保持 README 内容的原始格式 + # 使用 jq 生成 JSON 数据,以确保没有格式错误 JSON_PAYLOAD=$(jq -n \ --arg title "${FORMATTED_TIME}最新每天更新OpenWRT&LEDE x86/64 软路由精品稳定版固件下载含插件" \ - --argjson description "$wp_content" \ + --arg content "${{ env.wp_content }}" \ --arg post_status "$POST_STATUS" \ - --arg firmware_version "$firmware_version" \ - --arg formatted_time "$FORMATTED_TIME" \ + --arg firmware_version "${{ env.firmware_version }}" \ + --arg kernel_version "6.X" \ + --arg file_size "1024MB" \ + --arg update_time "$FORMATTED_TIME" \ '{ title: $title, - description: $description, + description: $content, post_status: $post_status, custom_fields: [ {key: "wb_dl_firmware_version", value: $firmware_version}, - {key: "wb_dl_kernel_version", value: "6.X"}, - {key: "wb_dl_file_size", value: "1024MB"}, - {key: "wb_dl_update_time", value: $formatted_time} + {key: "wb_dl_kernel_version", value: $kernel_version}, + {key: "wb_dl_file_size", value: $file_size}, + {key: "wb_dl_update_time", value: $update_time} ] }' )