normalize workflow input defaults

This commit is contained in:
xopenwrt 2026-06-29 22:23:30 +08:00
parent e1a8af7f83
commit f5492f01c6
4 changed files with 30 additions and 12 deletions

View File

@ -13,10 +13,12 @@ on:
inputs: inputs:
Release: Release:
description: '是否上传到Github' description: '是否上传到Github'
default: 'true' type: boolean
default: true
SharePoint: SharePoint:
description: '是否上传到SharePoint' description: '是否上传到SharePoint'
default: 'true' type: boolean
default: true
Tempoary_IP: Tempoary_IP:
description: '固件 IP 地址 [可选]' description: '固件 IP 地址 [可选]'
default: '192.168.2.200' default: '192.168.2.200'
@ -78,8 +80,8 @@ jobs:
id: date id: date
run: | run: |
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV echo "Release=${{ github.event.inputs.Release || 'true' }}" >> $GITHUB_ENV
echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV echo "SharePoint=${{ github.event.inputs.SharePoint || 'true' }}" >> $GITHUB_ENV
echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if [ "${{ env.DELETE_USELESS_FILES }}" == true ] if [ "${{ env.DELETE_USELESS_FILES }}" == true ]

View File

@ -13,10 +13,12 @@ on:
inputs: inputs:
Release: Release:
description: '是否上传到Github' description: '是否上传到Github'
default: 'true' type: boolean
default: true
SharePoint: SharePoint:
description: '是否上传到SharePoint' description: '是否上传到SharePoint'
default: 'true' type: boolean
default: true
Tempoary_IP: Tempoary_IP:
description: '固件 IP 地址 [可选]' description: '固件 IP 地址 [可选]'
default: '192.168.2.200' default: '192.168.2.200'
@ -93,8 +95,8 @@ jobs:
id: date id: date
run: | run: |
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV echo "Release=${{ github.event.inputs.Release || 'true' }}" >> $GITHUB_ENV
echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV echo "SharePoint=${{ github.event.inputs.SharePoint || 'true' }}" >> $GITHUB_ENV
echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV

View File

@ -13,10 +13,12 @@ on:
inputs: inputs:
Release: Release:
description: '是否上传到Github' description: '是否上传到Github'
default: 'true' type: boolean
default: true
SharePoint: SharePoint:
description: '是否上传到SharePoint' description: '是否上传到SharePoint'
default: 'true' type: boolean
default: true
Tempoary_IP: Tempoary_IP:
description: '固件 IP 地址 [可选]' description: '固件 IP 地址 [可选]'
default: '192.168.2.200' default: '192.168.2.200'
@ -94,8 +96,8 @@ jobs:
id: date id: date
run: | run: |
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
echo "Release=${{ github.event.inputs.Release }}" >> $GITHUB_ENV echo "Release=${{ github.event.inputs.Release || 'true' }}" >> $GITHUB_ENV
echo "SharePoint=${{ github.event.inputs.SharePoint }}" >> $GITHUB_ENV echo "SharePoint=${{ github.event.inputs.SharePoint || 'true' }}" >> $GITHUB_ENV
echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT echo "data2=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV echo "NOW_DATA_VERSION=v$(date +'%Y-%m-%d')" >> $GITHUB_ENV

View File

@ -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.