viam-rust-utils 0.6.1

Utilities designed for use with Viamrobotics's SDKs
Documentation
name: Update Protos + Open PR

on:
  workflow_dispatch:
  repository_dispatch:
    types:
      - protos-updated

jobs:
  update-protos:
    if: github.repository_owner == 'viamrobotics'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: bufbuild/buf-setup-action@v1.28.1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
      - uses: arduino/setup-protoc@v1
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
      - name: Generate buf
        run: make buf
        env:
          BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
      - name: Add + Commit + Open PR
        uses: peter-evans/create-pull-request@v3
        with:
          commit-message: '[WORKFLOW] Updating protos from ${{ github.event.client_payload.repo_name }}, commit: ${{ github.event.client_payload.sha }}'
          branch: 'origin/update-protos'
          delete-branch: true
          title: Automated Protos Update
          body: This is an auto-generated PR to update proto definitions. Check the commits to see which repos and commits are responsible for the changes
          assignees: njooma,stuqdog
          reviewers: njooma,stuqdog

      - name: Notify slack of failure
        uses: slackapi/slack-github-action@v1.24.0
        if: ${{ failure() }}
        with:
          payload: |
            {
              "text": "Rust-utils update protos job has failed",
              "username": "Rust-utils",
              "icon_url": "https://media.tenor.com/bZMubztJxGkAAAAe/charlie-brown-walking-charlie-brown.png"
            }
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEAM_SDK_WEBHOOK_URL }}