Skip to content

Modify the agent wlm datawarehouse endpoint env variable to remove si… #36

Modify the agent wlm datawarehouse endpoint env variable to remove si…

Modify the agent wlm datawarehouse endpoint env variable to remove si… #36

# This workflow will build all of the protos and commit them to the repo.
# This will pull the current workloadagentplatform submodule so the shared protos can be imported.
name: go-build-protos
on:
push:
branches: [ "main" ]
paths:
- 'protos/**.proto'
workflow_dispatch:
jobs:
build-protos:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.24.2'
- name: Add workloadagentplatform submodule
run: |
git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
git submodule add https://github.com/GoogleCloudPlatform/workloadagentplatform
cd workloadagentplatform
# this is the hash of the workloadagentplatform submodule
# get the hash by running: go list -m -json github.com/GoogleCloudPlatform/workloadagentplatform@main
git checkout 64b59c6392f2aaf421479a0c2f4bfdfafe85cf81
cd ..
find workloadagentplatform/sharedprotos -type f -exec sed -i 's|"sharedprotos|"workloadagentplatform/sharedprotos|g' {} +
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Install protoc-gen-go
run: |
go install github.com/golang/protobuf/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- name: Compile protocol buffers
run: |
export PATH=${PATH}:`go env GOPATH`/bin
protoc --go_opt=paths=source_relative protos/**/*.proto --go_out=.
- name: Commit the compiled protos
run: |
git rm -f workloadagentplatform
git config --global user.name 'Git bot'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add protos
if ! git commit -m "Auto updated compiled protocol buffers"; then
echo "No changes to commit."
else
git push
fi
- name: Notify on failure
if: ${{ failure() }}
uses: cinotify/github-action@main
with:
to: '[email protected]'
subject: '[Failure] GitHub Workload Agent Protocol Buffer Build and Commit failed'
body: 'There was a failure for the GitHub Workload Agent workflow go-build-protos action.\n\n https://github.com/GoogleCloudPlatform/workloadagent/actions/runs/${{ github.run_id }}/jobs/${{ github.job }}'