Skip to content

protos-updated

protos-updated #269

Workflow file for this run

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
container:
image: ghcr.io/cirruslabs/flutter:latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Flutter
run: flutter pub get
- name: Update Proto Tag
run: sed -i "s/apiTag = 'v[0-9]*\.[0-9]*\.[0-9]*'/apiTag = '${{ github.event.client_payload.tag }}'/" lib/src/utils.dart
- name: Generate buf
run: make buf
env:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
- name: Format
run: make format
- name: Add + Commit + Open PR
uses: peter-evans/create-pull-request@v5
with:
commit-message: "[WORKFLOW] Updating protos from ${{ github.event.client_payload.repo_name }}, commit: ${{ github.event.client_payload.sha }}"
branch: "workflow/update-protos"
delete-branch: true
base: main
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: viamrobotics/sdk-netcode
reviewers: viamrobotics/sdk-netcode
token: ${{ secrets.GIT_ACCESS_TOKEN }}
- name: Notify slack of failure
uses: slackapi/[email protected]
if: ${{ failure() }}
with:
payload: |
{
"text": "Flutter SDK update protos job has failed",
"username": "Flutter SDK",
"icon_url": "https://media.tenor.com/bZMubztJxGkAAAAe/charlie-brown-walking-charlie-brown.png"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEAM_SDK_WEBHOOK_URL }}