Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bstoll committed Jun 12, 2024
1 parent a8f8b9a commit f2be33a
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/proto_breaking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,21 @@ jobs:
TMPDIRHEAD="${TMPDIR}/head"
extract_protodesc() {
local TMPTARGETDIR="${1}"
local TARGETS="$(bazel query 'attr("generator_function", "^proto_library$", "//...")' 2>/dev/null)"
local GENF="$(bazel info bazel-genfiles)"
local TMPTARGETDIR
local TARGETS
local GENF
local TARGETDIR
local PROTONAME
TMPTARGETDIR="${1}"
TARGETS="$(bazel query 'attr("generator_function", "^proto_library$", "//...")' 2>/dev/null)"
GENF="$(bazel info bazel-genfiles)"
for TARGET in ${TARGETS}; do
local TARGETDIR="$(echo "${TARGET}" | cut -d ":" -f1 | sed 's#^//##')"
local PROTONAME="$(echo "${TARGET}" | cut -d ":" -f2-)"
TARGETDIR="$(echo "${TARGET}" | cut -d ":" -f1 | sed 's#^//##')"
PROTONAME="$(echo "${TARGET}" | cut -d ":" -f2-)"
mkdir -p "${TMPTARGETDIR}/${TARGETDIR}"
bazel build "${TARGET}"
cp "${GENF}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin" "${TMPTARGETDIR}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin"
cp "${GENF}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin" \
"${TMPTARGETDIR}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin"
done
}
Expand All @@ -71,9 +77,10 @@ jobs:
PROTONAME="$(echo "${TARGET}" | cut -d ":" -f2-)"
BASEPROTODESC="${TMPDIRBASE}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin"
HEADPROTODESC="${TMPDIRHEAD}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin"
if [ -f ${BASEPROTODESC} ] && [ -f ${HEADPROTODESC} ]; then
if [ -f "${BASEPROTODESC}" ] && [ -f "${HEADPROTODESC}" ]; then
echo "Comparing build target ${TARGET} at HEAD and BASE..."
OUTPUT=$(proto-breaking-change-detector --original_descriptor_set_file_path="${BASEPROTODESC}" --update_descriptor_set_file_path="${HEADPROTODESC}" --human_readable_message 2>&1)
OUTPUT=$(proto-breaking-change-detector --original_descriptor_set_file_path="${BASEPROTODESC}" \
--update_descriptor_set_file_path="${HEADPROTODESC}" --human_readable_message 2>&1)
if [ "${OUTPUT}" == "" ]; then
echo "No breaking changes."
else
Expand Down

0 comments on commit f2be33a

Please sign in to comment.