Address SonarCloud quality gate

- Use [[ ]] for conditional tests in generate.sh scripts
- Pin arduino/setup-protoc to full commit SHA
This commit is contained in:
riccardom
2026-05-19 09:04:40 +02:00
parent 0151cbd3e3
commit 0920fa1fa9
6 changed files with 6 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ jobs:
go-version-file: go.mod
- name: Setup protoc
uses: arduino/setup-protoc@v3
uses: arduino/setup-protoc@f4d5893b897028ff5739576ea0409746887fa536 # v3.0.0
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -17,7 +17,7 @@ repo_root=$(git rev-parse --show-toplevel)
. "$repo_root/proto-tools.env"
actual_protoc=$(protoc --version | awk '{print $2}')
if [ "$actual_protoc" != "$PROTOC_VERSION" ]; then
if [[ "$actual_protoc" != "$PROTOC_VERSION" ]]; then
echo "ERROR: protoc version $actual_protoc differs from pinned $PROTOC_VERSION" >&2
echo "Install protoc $PROTOC_VERSION from https://github.com/protocolbuffers/protobuf/releases" >&2
exit 1

View File

@@ -17,7 +17,7 @@ repo_root=$(git rev-parse --show-toplevel)
. "$repo_root/proto-tools.env"
actual_protoc=$(protoc --version | awk '{print $2}')
if [ "$actual_protoc" != "$PROTOC_VERSION" ]; then
if [[ "$actual_protoc" != "$PROTOC_VERSION" ]]; then
echo "ERROR: protoc version $actual_protoc differs from pinned $PROTOC_VERSION" >&2
echo "Install protoc $PROTOC_VERSION from https://github.com/protocolbuffers/protobuf/releases" >&2
exit 1

View File

@@ -17,7 +17,7 @@ repo_root=$(git rev-parse --show-toplevel)
. "$repo_root/proto-tools.env"
actual_protoc=$(protoc --version | awk '{print $2}')
if [ "$actual_protoc" != "$PROTOC_VERSION" ]; then
if [[ "$actual_protoc" != "$PROTOC_VERSION" ]]; then
echo "ERROR: protoc version $actual_protoc differs from pinned $PROTOC_VERSION" >&2
echo "Install protoc $PROTOC_VERSION from https://github.com/protocolbuffers/protobuf/releases" >&2
exit 1

View File

@@ -17,7 +17,7 @@ repo_root=$(git rev-parse --show-toplevel)
. "$repo_root/proto-tools.env"
actual_protoc=$(protoc --version | awk '{print $2}')
if [ "$actual_protoc" != "$PROTOC_VERSION" ]; then
if [[ "$actual_protoc" != "$PROTOC_VERSION" ]]; then
echo "ERROR: protoc version $actual_protoc differs from pinned $PROTOC_VERSION" >&2
echo "Install protoc $PROTOC_VERSION from https://github.com/protocolbuffers/protobuf/releases" >&2
exit 1

View File

@@ -17,7 +17,7 @@ repo_root=$(git rev-parse --show-toplevel)
. "$repo_root/proto-tools.env"
actual_protoc=$(protoc --version | awk '{print $2}')
if [ "$actual_protoc" != "$PROTOC_VERSION" ]; then
if [[ "$actual_protoc" != "$PROTOC_VERSION" ]]; then
echo "ERROR: protoc version $actual_protoc differs from pinned $PROTOC_VERSION" >&2
echo "Install protoc $PROTOC_VERSION from https://github.com/protocolbuffers/protobuf/releases" >&2
exit 1