소스 검색

ci(apply-kernel-branding): fix output redirection in branding script

The sed command was incorrectly deleting the last line containing 'echo' and then appending the branding echo, which could lead to malformed scripts. Directly writing the echo command to the file ensures the script is correctly generated for Wild kernel variants.
TheWildJames 4 달 전
부모
커밋
1bef322ed1
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      .github/actions/apply-kernel-branding/action.yml

+ 3 - 3
.github/actions/apply-kernel-branding/action.yml

@@ -24,11 +24,11 @@ runs:
         DEFCONFIG="${GITHUB_WORKSPACE}/kernel/common/arch/arm64/configs/gki_defconfig"
 
         if [ "${{ inputs.variant }}" = "Wild" ]; then
-          sed -i '${/^echo /d;}' scripts/setlocalversion
+          sed -i ':a; $!{N; ba}; s/\n\([^\n]*^echo [^\n]*\)\n$/\n/;' scripts/setlocalversion
           if [ "$(printf '%s\n' "${{ inputs.kernel_version }}" "6.6" | sort -V | head -n1)" = "6.6" ]; then
-            echo 'echo "${KERNELVERSION}-Wild"'
+            echo 'echo "${KERNELVERSION}-Wild"' >> scripts/setlocalversion
           else
-            echo 'echo "-Wild"'
+            echo 'echo "-Wild"' >> scripts/setlocalversion
           fi
         else
           if grep -q '^CONFIG_LOCALVERSION=' "$DEFCONFIG"; then