| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- name: Fetch Latest Commits
- description: "Fetches the latest commit hashes for Wild KSU, AnyKernel3, Kernel Patches, and SUSFS"
- inputs:
- ksu_commit:
- description: "Optional: Specific Wild KSU commit to use"
- required: false
- default: ""
- outputs:
- ksu_commit:
- description: "Wild KSU Commit"
- value: ${{ steps.commits.outputs.ksu_commit }}
- anykernel_commit:
- description: "AnyKernel3 Commit"
- value: ${{ steps.commits.outputs.anykernel_commit }}
- patches_commit:
- description: "Kernel Patches Commit"
- value: ${{ steps.commits.outputs.patches_commit }}
- susfs_commit:
- description: "SUSFS Commit (Map)"
- value: ${{ steps.commits.outputs.susfs_commit }}
- runs:
- using: "composite"
- steps:
- - name: Get Latest Commits
- id: commits
- shell: bash
- run: |
- # Helper to get latest commit from remote without cloning full repo
- get_commit() {
- git ls-remote "$1" "$2" | awk '{print $1}'
- }
- echo "Fetching latest commits..."
-
- # Wild KSU
- if [ -n "${{ inputs.ksu_commit }}" ]; then
- # 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" "refs/heads/canary")
- echo "Wild KSU: $ksu_commit"
- fi
- echo "ksu_commit=$ksu_commit" >> $GITHUB_OUTPUT
-
- # AnyKernel3
- AK3_COMMIT=$(get_commit "https://github.com/WildKernels/AnyKernel3.git" "refs/heads/gki-2.0")
- echo "AnyKernel3: $AK3_COMMIT"
- echo "anykernel_commit=$AK3_COMMIT" >> $GITHUB_OUTPUT
-
- # Kernel Patches
- PATCHES_COMMIT=$(get_commit "https://github.com/WildKernels/kernel_patches.git" "HEAD")
- echo "Kernel Patches: $PATCHES_COMMIT"
- echo "patches_commit=$PATCHES_COMMIT" >> $GITHUB_OUTPUT
-
- # SUSFS (using gitlab) - Fetch all relevant branches
- SUSFS_REPO="https://gitlab.com/simonpunk/susfs4ksu.git"
- echo "Fetching SUSFS commits for all branches..."
-
- # We need to construct a JSON object or a simple string map
- # Format: branch1:commit1,branch2:commit2,...
-
- BRANCHES=(
- "gki-android12-5.10"
- "gki-android13-5.10"
- "gki-android13-5.15"
- "gki-android14-5.15"
- "gki-android14-6.1"
- "gki-android15-6.6"
- "gki-android16-6.12"
- )
-
- SUSFS_MAP=""
- for branch in "${BRANCHES[@]}"; do
- COMMIT=$(get_commit "$SUSFS_REPO" "refs/heads/$branch")
- if [ -n "$COMMIT" ]; then
- echo " $branch: $COMMIT"
- if [ -z "$SUSFS_MAP" ]; then
- SUSFS_MAP="$branch:$COMMIT"
- else
- SUSFS_MAP="$SUSFS_MAP,$branch:$COMMIT"
- fi
- else
- echo " $branch: Not found"
- fi
- done
-
- echo "susfs_commit=$SUSFS_MAP" >> $GITHUB_OUTPUT
|