diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e49da3..266f574 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,13 @@ name: Build Modules -on: [workflow_call, workflow_dispatch] +on: + workflow_call: + inputs: + from_ci: + type: boolean + required: false + default: true + + workflow_dispatch: jobs: run: @@ -17,6 +25,16 @@ jobs: fetch-depth: 0 submodules: true + - name: Update config + if: ${{ inputs.from_ci }} + run: | + if git checkout origin/update build.md; then + UPDATE_CFG=$(./build.sh config.toml --config-update) + if [ "$UPDATE_CFG" ]; then + echo "$UPDATE_CFG" > config.toml + fi + fi + - name: Get next version code id: next_ver_code env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d07d75b..d348b74 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,6 @@ jobs: else UPDATE_CFG=$(./build.sh config.toml --config-update) if [ "$UPDATE_CFG" ]; then - echo "$UPDATE_CFG" > config.toml echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT else echo "SHOULD_BUILD=0" >> $GITHUB_OUTPUT diff --git a/utils.sh b/utils.sh index 7ffe4c3..8f40ae5 100755 --- a/utils.sh +++ b/utils.sh @@ -25,7 +25,7 @@ toml_get_table_names() { fi echo "$tn" } -toml_get_table() { sed -n "/\[${1}]/,/^\[.*]$/p" <<<"$__TOML__" | sed '/^\[/d'; } +toml_get_table() { sed -n "/\[${1}]/,/^\[.*]$/p" <<<"$__TOML__" | sed '${/^\[/d;}'; } toml_get() { local table=$1 key=$2 val val=$(grep -m 1 "^${key}=" <<<"$table") && sed -e "s/^\"//; s/\"$//" <<<"${val#*=}"