Update Proto #185
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Update Proto" | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "Branch in api-go repo to update protos (default: master)" | |
required: false | |
default: master | |
commit_author: | |
description: "Commit author username" | |
required: true | |
commit_author_email: | |
description: "Commit author email" | |
required: true | |
commit_message: | |
description: "Commit message" | |
required: true | |
jobs: | |
sync: | |
name: "Update proto" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Generate token | |
id: generate_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.TEMPORAL_CICD_APP_ID }} | |
private-key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
persist-credentials: true | |
ref: ${{ github.event.inputs.branch }} | |
submodules: true | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
- uses: arduino/setup-protoc@v1 | |
with: | |
version: "3.x" | |
- name: Re-build proto | |
run: | | |
make install update-proto test | |
- name: Commit update | |
env: | |
GIT_AUTHOR_NAME: ${{ github.event.inputs.commit_author }} | |
GIT_AUTHOR_EMAIL: ${{ github.event.inputs.commit_author_email }} | |
GIT_COMMITTER_NAME: ${{ github.event.inputs.commit_author }} | |
GIT_COMMITTER_EMAIL: ${{ github.event.inputs.commit_author_email }} | |
GIT_COMMIT_MESSAGE: ${{ github.event.inputs.commit_message }} | |
run: | | |
git add . | |
git commit -m "${GIT_COMMIT_MESSAGE}" | |
if [ $? -eq 0 ]; then | |
git push | |
else | |
echo "No changes to commit" | |
fi |