mirror of
https://github.com/esphome/esphome.git
synced 2024-12-23 14:04:53 +01:00
30 lines
603 B
Text
30 lines
603 B
Text
|
#!/bin/bash
|
||
|
|
||
|
components=()
|
||
|
for c_diff in $(git diff ${1}..${2} --name-only esphome/components); do
|
||
|
base=${c_diff#esphome/components/}
|
||
|
component=`dirname ${base}`
|
||
|
|
||
|
if [[ "${component}" == "." ]]; then
|
||
|
component=${platform}
|
||
|
fi
|
||
|
|
||
|
if [[ ! "${components[@]}" =~ "${component}" ]]; then
|
||
|
components+=($component)
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
labels=()
|
||
|
|
||
|
echo "Components:"
|
||
|
for component in ${components[@]}; do
|
||
|
echo " ${component}"
|
||
|
labels+=("component: $component")
|
||
|
done
|
||
|
|
||
|
echo "Labels: ${labels[@]}"
|
||
|
|
||
|
output=$(printf '%s\n' "${labels[@]}" | jq -R . | jq -c -s .)
|
||
|
|
||
|
echo "::set-output name=labels::${output}"
|