| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- # .github/actions/set-kernel-config/action.yml
- name: Set Kernel Config
- description: Writes kernel config values into a fragment (NO defconfig edits)
- inputs:
- configs:
- required: true
- fragment:
- required: true
- runs:
- using: composite
- steps:
- - name: Apply configs
- shell: bash
- run: |
- set -euo pipefail
- FRAGMENT="${{ inputs.fragment }}"
- touch "${FRAGMENT}"
- set_config() {
- local input="$1"
- # trim whitespace
- input="$(echo "$input" | xargs)"
- [[ -z "$input" || "$input" == \#* ]] && return
- if [[ "$input" == *"="* ]]; then
- local config="${input%%=*}"
- local value="${input#*=}"
- else
- local config="$input"
- local value="y"
- fi
- # remove any existing entry (prevents duplicates/conflicts)
- sed -i "/^${config}=/d" "${FRAGMENT}"
- # write clean value
- echo "${config}=${value}" >> "${FRAGMENT}"
- }
- while IFS= read -r line; do
- set_config "$line"
- done <<< "${{ inputs.configs }}"
|