action.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: 'Parse Kernel Version'
  2. description: 'Parses input kernel_version into kernel/android/patch parts and exports them'
  3. inputs:
  4. kernel_version:
  5. required: true
  6. type: string
  7. outputs:
  8. android_version:
  9. value: ${{ steps.parse.outputs.android_version }}
  10. kernel_version:
  11. value: ${{ steps.parse.outputs.kernel_version }}
  12. sub_level:
  13. value: ${{ steps.parse.outputs.sub_level }}
  14. os_patch_level:
  15. value: ${{ steps.parse.outputs.os_patch_level }}
  16. runs:
  17. using: composite
  18. steps:
  19. - id: parse
  20. shell: bash
  21. run: |
  22. set -euo pipefail
  23. INPUT_VERSION="${{ inputs.kernel_version }}"
  24. IFS='-' read -r KERNEL_PART ANDROID_PART REST <<< "$INPUT_VERSION"
  25. KERNEL_VERSION="${KERNEL_PART%.*}"
  26. SUB_LEVEL="${KERNEL_PART##*.}"
  27. ANDROID_VERSION="$ANDROID_PART"
  28. OS_PATCH_LEVEL="$REST"
  29. echo "ANDROID_VERSION=$ANDROID_VERSION" >> "$GITHUB_ENV"
  30. echo "KERNEL_VERSION=$KERNEL_VERSION" >> "$GITHUB_ENV"
  31. echo "SUB_LEVEL=$SUB_LEVEL" >> "$GITHUB_ENV"
  32. echo "OS_PATCH_LEVEL=$OS_PATCH_LEVEL" >> "$GITHUB_ENV"
  33. echo "android_version=$ANDROID_VERSION" >> "$GITHUB_OUTPUT"
  34. echo "kernel_version=$KERNEL_VERSION" >> "$GITHUB_OUTPUT"
  35. echo "sub_level=$SUB_LEVEL" >> "$GITHUB_OUTPUT"
  36. echo "os_patch_level=$OS_PATCH_LEVEL" >> "$GITHUB_OUTPUT"