From f5492f01c6904f170ab40b79941f3d3d8e0342fe Mon Sep 17 00:00:00 2001 From: xopenwrt Date: Mon, 29 Jun 2026 22:23:30 +0800 Subject: [PATCH] normalize workflow input defaults --- .github/workflows/X-x86_64_X.yml | 10 ++++++---- .github/workflows/X-x86_64_Y.yml | 10 ++++++---- .github/workflows/X-x86_64_Z.yml | 10 ++++++---- AI_CHANGELOG_WORKFLOW_INPUT_DEFAULTS.md | 12 ++++++++++++ 4 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 AI_CHANGELOG_WORKFLOW_INPUT_DEFAULTS.md diff --git a/.github/workflows/X-x86_64_X.yml b/.github/workflows/X-x86_64_X.yml index 40ad0ff..2bab4cd 100644 --- a/.github/workflows/X-x86_64_X.yml +++ b/.github/workflows/X-x86_64_X.yml @@ -13,10 +13,12 @@ on: inputs: Release: description: '是否上传到Github' - default: 'true' + type: boolean + default: true SharePoint: description: '是否上传到SharePoint' - default: 'true' + type: boolean + default: true Tempoary_IP: description: '固件 IP 地址 [可选]' default: '192.168.2.200' @@ -78,8 +80,8 @@ jobs: id: date run: | echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV - echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV + echo "Release=${{ github.event.inputs.Release || 'true' }}" >> $GITHUB_ENV + echo "SharePoint=${{ github.event.inputs.SharePoint || 'true' }}" >> $GITHUB_ENV echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV if [ "${{ env.DELETE_USELESS_FILES }}" == true ] diff --git a/.github/workflows/X-x86_64_Y.yml b/.github/workflows/X-x86_64_Y.yml index c07492a..fd25022 100644 --- a/.github/workflows/X-x86_64_Y.yml +++ b/.github/workflows/X-x86_64_Y.yml @@ -13,10 +13,12 @@ on: inputs: Release: description: '是否上传到Github' - default: 'true' + type: boolean + default: true SharePoint: description: '是否上传到SharePoint' - default: 'true' + type: boolean + default: true Tempoary_IP: description: '固件 IP 地址 [可选]' default: '192.168.2.200' @@ -93,8 +95,8 @@ jobs: id: date run: | echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV - echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV + echo "Release=${{ github.event.inputs.Release || 'true' }}" >> $GITHUB_ENV + echo "SharePoint=${{ github.event.inputs.SharePoint || 'true' }}" >> $GITHUB_ENV echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV diff --git a/.github/workflows/X-x86_64_Z.yml b/.github/workflows/X-x86_64_Z.yml index 44f6459..3368624 100644 --- a/.github/workflows/X-x86_64_Z.yml +++ b/.github/workflows/X-x86_64_Z.yml @@ -13,10 +13,12 @@ on: inputs: Release: description: '是否上传到Github' - default: 'true' + type: boolean + default: true SharePoint: description: '是否上传到SharePoint' - default: 'true' + type: boolean + default: true Tempoary_IP: description: '固件 IP 地址 [可选]' default: '192.168.2.200' @@ -94,8 +96,8 @@ jobs: id: date run: | echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV - echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV + echo "Release=${{ github.event.inputs.Release || 'true' }}" >> $GITHUB_ENV + echo "SharePoint=${{ github.event.inputs.SharePoint || 'true' }}" >> $GITHUB_ENV echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV diff --git a/AI_CHANGELOG_WORKFLOW_INPUT_DEFAULTS.md b/AI_CHANGELOG_WORKFLOW_INPUT_DEFAULTS.md new file mode 100644 index 0000000..5464581 --- /dev/null +++ b/AI_CHANGELOG_WORKFLOW_INPUT_DEFAULTS.md @@ -0,0 +1,12 @@ +# AI Modification Log: Workflow Input Defaults + +Date: 2026-06-29 + +## Change + +- Added `type: boolean` to the `Release` and `SharePoint` workflow dispatch inputs in X/Y/Z workflows. +- Changed env export lines to default `Release` and `SharePoint` to `true` when `github.event.inputs` is absent, such as repository dispatch runs. + +## Reason + +The workflows also support `repository_dispatch`, where `github.event.inputs` is not populated. Without explicit fallback values, release and SharePoint conditions can see empty strings and skip expected upload steps.