Skip to content

Trigger api-go Update #138

Trigger api-go Update

Trigger api-go Update #138

name: 'Trigger api-go Update'
on:
push:
branches:
- master
workflow_dispatch:
jobs:
notify:
name: 'Trigger api-go update'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Generate token
if: ${{ !env.ACT }}
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: Dispatch api-go Github Action
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}
COMMIT_AUTHOR: rodrigozhou
COMMIT_AUTHOR_EMAIL: [email protected]
COMMIT_MESSAGE: test
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GH_TOKEN" \
https://api.github.com/repos/temporalio/api-go/actions/workflows/update-proto.yml/dispatches \
-d '{"ref":"master", "inputs":{"branch":"rodrigozhou/test", "commit_author":"'"$COMMIT_AUTHOR"'", "commit_author_email":"'"$COMMIT_AUTHOR_EMAIL"'", "commit_message":"'"$COMMIT_MESSAGE"'"}}'
# gh workflow run update-proto.yml -R https://github.com/temporalio/api-go \
# -r master \
# -f branch="rodrigozhou/test" \
# -f commit_author="${COMMIT_AUTHOR}" \
# -f commit_author_email="${COMMIT_AUTHOR_EMAIL}" \
# -f commit_message="${COMMIT_MESSAGE}"