14 KiB
GitHub Actions X/Y/Z Scan Notes
Scan date: 2026-06-28
Scope
Target GitHub Actions:
.github/workflows/X-x86_64_X.yml.github/workflows/X-x86_64_Y.yml.github/workflows/X-x86_64_Z.yml
Target OpenWrt config files:
Configs/x86_64-XConfigs/x86_64-YConfigs/x86_64-Z
Build scripts used by these workflows:
Scripts/AutoBuild_Getenv.shScripts/AutoBuild_DiyScript.shScripts/AutoBuild_Function.shScripts/AutoBuild_Upcheck.sh
Related directories:
.github/workflows: GitHub Actions workflow definitions.Configs: OpenWrt.configprofiles.Scripts: shared build/env/update helper scripts.CustomFiles: patches, dependency files and Kconfig fragments injected by scripts.
Current Progress
Updated: 2026-06-29
- Active work branch:
ai, trackingorigin/ai. - Completed backlog items in the current AI task series: #1-#12, #14-#16, #20-#22, #27, #28, and #30.
- The current continuation task is #35: document the X/Y/Z x86_64 config intent and add a config optimization todo list.
- Larger unresolved items remain below; prefer one scoped commit per backlog item unless batching is requested.
Optimization Backlog
High Priority
-
Fix Z workflow S3 upload path typo.
- File:
.github/workflows/X-x86_64_Z.yml - Location: around line 322
- Problem:
FILE: ./${{ steps.date.outputs.date }}e/${{ env.SP_UEFI_VMDK }}has an extrae, so UEFI VMDK upload will look in the wrong directory.
- File:
-
Add
ifconditions to all S3/SharePoint upload steps.- Files:
.github/workflows/X-x86_64_X.yml,.github/workflows/X-x86_64_Y.yml,.github/workflows/X-x86_64_Z.yml - Locations: X around lines 316-350, Y around lines 311-345, Z around lines 310-366
- Problem:
SharePointinput is written to$GITHUB_ENV, but these upload steps do not checkenv.SharePoint == 'true'orenv.Result == 'true'. - Suggested condition:
if: env.SharePoint == 'true' && env.Result == 'true' && !cancelled().
- Files:
-
Fix build result detection for
make | tee.- Files: all X/Y/Z workflows
- Locations: X around line 223, Y around line 220, Z around lines 217-220
- Problems:
- X/Y use
make -j4 | tee ... || make -j1 V=s; withoutset -o pipefail, the pipeline can succeed becauseteesucceeds even whenmakefails. - Z adds
pipefail, but then runssedaftermake;$?is likely checkingsed, not the build.
- X/Y use
- Suggested pattern: run
set -o pipefail, run primary build, run fallback build on failure, store the build exit code immediately, then writeResult=true/false.
-
Move Z mosdns
sedfix before build.- File:
.github/workflows/X-x86_64_Z.yml - Location: around lines 217-219
- Problem:
sed -i 's/CGO_ENABLED=0/CGO_ENABLED=1/g' feeds/packages/net/mosdns/Makefileis aftermake, so the intended fix is applied too late. X/Y apply it beforemake.
- File:
-
Stop mutating tracked config files during workflow execution.
- Files: all X/Y/Z workflows
- Locations: X around lines 191-195, Y around lines 188-192, Z around lines 187-191
- Problem:
CONFIG_DEVELandCONFIG_CCACHEare appended to$GITHUB_WORKSPACE/Configs/$CONFIG_FILE. This mutates the checked-out repo copy and can duplicate lines during reruns or debugging. - Suggested fix: copy the selected config to a temp file or
.configfirst, then append CI-only options there.
-
Fix likely wrong config append in
Firmware_Diy_Main.- File:
Scripts/AutoBuild_Function.sh - Location: around line 133
- Problem:
echo -e "\nCONFIG_PACKAGE_luci-app-autoupdate=y" >> ${CONFIG_FILE}runs aftercd openwrt;${CONFIG_FILE}is the config name such asx86_64-Z, not.configor the full config path. This probably creates/edits an unintended file underopenwrt. - Suggested target:
${CONFIG_TEMP}or the generated.config.
- File:
-
Fix clone path/workdir usage.
- Files: all X/Y/Z workflows
- Locations: X around lines 160-163, Y around lines 157-160, Z around lines 156-159
- Problem:
/workdiris created, butgit clone ... openwrtclones into the workspace, thenln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrtdoes not move the clone into/workdir. - Suggested fix:
git clone -b "$REPO_BRANCH" "$REPO_URL" /workdir/openwrtthen symlink/workdir/openwrtinto$GITHUB_WORKSPACE/openwrt, or remove/workdirentirely.
-
Make
Check Build Updateconditional.- Files: all X/Y/Z workflows
- Locations: X around lines 228-232, Y around lines 224-228, Z around lines 222-226
- Problem: update checking runs even if the build failed or release upload is disabled. It depends on
openwrt/build_log.logand remote release files. - Suggested condition:
if: env.Result == 'true' && env.Release == 'true' && env.UPLOAD_RELEASES == 'true' && !cancelled().
-
Remove hard-coded release repository from update checker.
- File:
Scripts/AutoBuild_Upcheck.sh - Locations: around lines 97 and 114
- Problem: release history is fetched from
X-OpenWrt/X-OpenWrt-Dev, while workflows upload to${{ github.repository }}. - Suggested fix: use
${GITHUB_REPOSITORY}or pass the repository as an argument.
- File:
-
Replace deprecated
::set-output.- Files: all X/Y/Z workflows
- Locations: X around line 68, Y around line 83, Z around line 84
- Problem:
::set-outputis deprecated. - Suggested fix:
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT".
-
Add explicit workflow permissions.
- Files: all X/Y/Z workflows
- Problem: releases and workflow-run deletion need write permissions. Current workflows rely on defaults.
- Suggested block:
permissions: contents: write, actions: writewith the minimum needed per workflow.
-
Add concurrency control.
- Files: all X/Y/Z workflows
- Problem: multiple runs can upload to the same
AutoUpdatetag and same date tag, causing races and overwrites. - Suggested fix: add
concurrencykeyed by workflow/config, or include run id in per-run release tags.
Maintainability
-
Consolidate X/Y/Z workflows.
- Files: all X/Y/Z workflows
- Problem: the three files are mostly copies, and drift has already produced Z-only bugs.
- Suggested fix: create one reusable workflow with
config_fileandflaginputs, or one matrix workflow for X/Y/Z.
-
Pin actions to stable versions or SHAs.
- Files: all X/Y/Z workflows
- Examples:
actions/checkout@main,actions/upload-artifact@main,easimon/maximize-build-space@master,klever1988/cachewrtbuild@main,GitRML/delete-workflow-runs@main,xopenwrt/s3-upload-github-action@master - Problem: moving branches reduce reproducibility and increase supply-chain risk.
- Suggested fix: use versioned tags such as
actions/checkout@v4,actions/upload-artifact@v4, or commit SHAs for third-party actions.
-
Use typed
workflow_dispatchinputs and normalize defaults.- Files: all X/Y/Z workflows
- Locations: inputs around lines 14-28
- Problems:
ReleaseandSharePointare free-form strings.repository_dispatchhas nogithub.event.inputs, so manual defaults may not apply.Tempoary_*is misspelled and spread across workflows/scripts.
- Suggested fix: use boolean typed inputs where possible; add safe defaults in shell; keep old
Tempoary_*as compatibility aliases if renaming.
-
Validate user inputs before using them in shell.
- Files: all X/Y/Z workflows and
Scripts/AutoBuild_Function.sh - Problems: dispatch inputs are interpolated directly into shell blocks and
$GITHUB_ENV. - Suggested fix: pass inputs through
env:, quote variables, validate config names againstConfigs/*, validate IP by regex plus octet range, and restrict flag characters.
- Files: all X/Y/Z workflows and
-
Replace repeated S3 upload steps with a loop or matrix.
- Files: all X/Y/Z workflows
- Problem: four nearly identical upload steps make path/name mistakes easy.
- Suggested fix: generate a list of existing firmware files and upload in a small script, or use a matrix with
FILEvalues.
-
Make firmware glob handling robust.
- Files: all X/Y/Z workflows
- Locations:
Download Github Release APIstep, X around lines 279-314, Y around lines 274-309, Z around lines 273-308 - Problem: if a glob has no match, the literal pattern can be exported and uploaded.
- Suggested fix: use
shopt -s nullglob, arrays, and skip missing files explicitly.
-
Normalize line endings and final newlines.
- Files:
.github/workflows/X-x86_64_Y.yml,.github/workflows/X-x86_64_Z.yml,Configs/x86_64-Y,Configs/x86_64-Z - Problem: diff showed CRLF-style content and missing newline at EOF in config files.
- Suggested fix: standardize on LF and add final newline.
- Files:
-
Remove debug/noise differences between X/Y/Z.
- File:
.github/workflows/X-x86_64_Z.yml - Examples:
docker imagesaround line 150, extralsaround lines 254 and 394 - Problem: useful while debugging, but causes drift and noisy logs if kept permanently.
- File:
Build Efficiency
-
Revisit download/build parallelism.
- Files: X/Y/Z workflows
- Examples: X uses
make download -j32; Y/Z use-j8; all build withmake -j4. - Suggested fix: use a shared variable such as
BUILD_JOBS: $(nproc)or a conservative configured number, then keep all workflows consistent.
-
Trim duplicate and unnecessary apt packages.
- Files: all X/Y/Z workflows
- Locations: init environment package list
- Examples:
zlib1g-devandgitappear more than once; editors likevim,nano,lrzszare probably unnecessary in CI. - Suggested fix: keep only required build dependencies and split comments by category.
-
Move package replacement before defconfig/download where possible.
- Files: all X/Y/Z workflows
- Locations: adguardhome/passwall package deletion and symlink in build step
- Problem: package replacement happens after
feeds install,make defconfig, andmake download; selected package metadata/download behavior may drift from the package actually built. - Suggested fix: perform package overrides before final
make defconfigandmake download.
-
Pin external package repositories or document why moving branches are used.
- Files: workflows and
Scripts/AutoBuild_DiyScript.sh - Examples:
sbwml/packages_lang_golang -b 26.x,OpenWrt-Passwall main,fw876 master,xopenwrt master - Problem: builds can change without repo changes.
- Suggested fix: pin to commits/tags for reproducible builds, or accept moving branches but document it.
- Files: workflows and
Script Robustness
-
Add stricter error handling carefully to scripts.
- Files:
Scripts/AutoBuild_*.sh - Problem: helper functions often log failures but return success, so missing packages/files can be hidden.
- Suggested fix: introduce
set -euo pipefailonly after auditing expected non-fatal commands, or make critical helpers return non-zero on failure.
- Files:
-
Quote variables in shell scripts.
- Files:
Scripts/AutoBuild_Function.sh,Scripts/AutoBuild_Upcheck.sh,Scripts/AutoBuild_DiyScript.sh - Examples:
cd $1,grep $1,find $2,rm ${SVN_REPO_NAME} -rf, manycat openwrt/${build_pkg_dir}/Makefile - Problem: spaces, glob characters, or empty variables can cause unintended behavior.
- Files:
-
Fix
Get_Release_Info.- File:
Scripts/AutoBuild_Getenv.sh - Location: around line 28
- Problem: backticks around
cat ... | grep ...execute the grep output as a command. - Suggested fix:
grep 'KERNEL_PATCHVER:=' "${OPENWRT_BUILD_DIR}/target/linux/x86/Makefile".
- File:
-
Make external IP lookup non-blocking.
- File:
Scripts/AutoBuild_Getenv.sh - Locations: around lines 18-21
- Problem: build info step depends on external APIs for logging.
- Suggested fix: add
curl --connect-timeout 5 --max-time 10and tolerate failures.
- File:
-
Improve
AutoBuild_Upcheck.shparsing.- File:
Scripts/AutoBuild_Upcheck.sh - Locations: around lines 23-93
- Problems: parses build logs with multiple
cat | grepchains, assumes Makefiles exist, and may duplicate package entries. - Suggested fix: use
awk/sort -u, quote paths, skip missing Makefiles, and record warnings.
- File:
-
Improve release tag comparison.
- File:
Scripts/AutoBuild_Upcheck.sh - Locations: around lines 97-114
- Problem: date tags are compared lexically and initialized with
v2023-1-1. - Suggested fix: normalize tags to
vYYYY-MM-DD, sort withsort -Vor parse dates explicitly.
- File:
Config Maintenance
-
Split common x86_64 config fragments from X/Y/Z differences.
- Files:
Configs/x86_64-X,Configs/x86_64-Y,Configs/x86_64-Z - Problem: target/image/IPv6/theme/base package settings are repeated, while X/Y/Z differ mainly by feature level.
- Suggested fix: maintain
x86_64-common,x86_64-X.fragment,x86_64-Y.fragment,x86_64-Z.fragment, then concatenate into.configin the workflow.
- Files:
-
Shrink configs with OpenWrt diffconfig.
- Files:
Configs/x86_64-X,Configs/x86_64-Y,Configs/x86_64-Z - Problem: configs include redundant selected dependencies and stale comments.
- Suggested fix: after a successful build, use OpenWrt
scripts/diffconfig.shto keep only meaningful deltas.
- Files:
-
Re-check Z Image Builder expectations.
- File:
Configs/x86_64-Z - Locations: around lines 8-10
- Problem: Z enables
CONFIG_IBandCONFIG_IB_STANDALONE, but the workflow still processes/uploads only firmware image patterns. - Suggested fix: decide whether Image Builder artifacts should be uploaded, ignored, or disabled.
- File:
-
Clean stale kernel comments.
- Files:
Configs/x86_64-X,Configs/x86_64-Y,Configs/x86_64-Z - Problem: commented
KERNEL_PATCHVERlines do not affect OpenWrt config and can mislead later edits. - Suggested fix: remove stale comments or move kernel selection into the correct build mechanism.
- Files:
-
Document X/Y/Z config intent and optimization todos.
- Files:
Configs/x86_64-X,Configs/x86_64-Y,Configs/x86_64-Z,NOTES_X86_CONFIG_OPTIMIZATION.md - Problem: the three x86_64 profiles do not clearly state their intended role, shared maintenance rules, or follow-up cleanup path.
- Suggested fix: add safe comment headers to each config and maintain a dedicated todo list for config-specific optimization work.
- Files:
Suggested First Fix Batch
- Fix Z upload path typo and Z mosdns build-order issue.
- Add S3 upload
ifconditions usingSharePoint,Result, and!cancelled(). - Replace all build commands with a shared pipefail-safe result pattern.
- Stop appending CI-only config options to tracked
Configs/*. - Replace deprecated
set-outputwith$GITHUB_OUTPUT.