Просмотр исходного кода

ci(fetch-commits): improve Wild KSU commit resolution

Add logic to resolve input as a branch/tag ref before falling back to a direct SHA. This ensures the correct commit is fetched when a branch name like "canary" is provided, improving reliability of the automation.
TheWildJames 6 месяцев назад
Родитель
Сommit
56a0e15d76
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      .github/actions/fetch-commits/action.yml

+ 10 - 2
.github/actions/fetch-commits/action.yml

@@ -35,10 +35,18 @@ runs:
         
         # Wild KSU
         if [ -n "${{ inputs.ksu_commit }}" ]; then
-          ksu_commit="${{ inputs.ksu_commit }}"
+          # Try to resolve input as a ref (branch/tag)
+          resolved_commit=$(get_commit "https://github.com/WildKernels/Wild_KSU.git" "${{ inputs.ksu_commit }}")
+          
+          if [ -n "$resolved_commit" ]; then
+            ksu_commit="$resolved_commit"
+          else
+            # If resolution failed, assume input is a commit SHA
+            ksu_commit="${{ inputs.ksu_commit }}"
+          fi
           echo "Using provided Wild KSU commit: $ksu_commit"
         else
-          ksu_commit=$(get_commit "https://github.com/WildKernels/Wild_KSU.git -b canary")
+          ksu_commit=$(get_commit "https://github.com/WildKernels/Wild_KSU.git" "refs/heads/canary")
           echo "Wild KSU: $ksu_commit"
         fi
         echo "ksu_commit=$ksu_commit" >> $GITHUB_OUTPUT