diff --git a/.github/workflows/static-checks.yaml b/.github/workflows/static-checks.yaml index d160963149..7ac0d810d5 100644 --- a/.github/workflows/static-checks.yaml +++ b/.github/workflows/static-checks.yaml @@ -150,3 +150,36 @@ jobs: needs: skipper if: ${{ needs.skipper.outputs.skip_static != 'yes' }} uses: ./.github/workflows/govulncheck.yaml + + codegen: + runs-on: ubuntu-22.04 + needs: skipper + if: ${{ needs.skipper.outputs.skip_static != 'yes' }} + permissions: + contents: read # for checkout + steps: + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + persist-credentials: false + - name: generate + run: make -C src/agent generate-protocols + - name: check for diff + run: | + diff=$(git diff) + if [[ -z "${diff}" ]]; then + echo "No diff detected." + exit 0 + fi + + cat << EOF >> "${GITHUB_STEP_SUMMARY}" + Run \`make -C src/agent generate-protocols\` to update protobuf bindings. + + \`\`\`diff + ${diff} + \`\`\` + EOF + + echo "::error::Golang protobuf bindings need to be regenerated (see Github step summary for diff)." + exit 1