ci: fix passing config

This commit is contained in:
j-hc 2023-10-01 01:54:24 +03:00
parent ddbbc195de
commit 8bcdd92c4d
No known key found for this signature in database
GPG Key ID: B69B8F690911EFCC
3 changed files with 20 additions and 3 deletions

View File

@ -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:

View File

@ -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

View File

@ -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#*=}"