Skip to content

Replace GHA token in workflow to trigger api-go update (#407) #130

Replace GHA token in workflow to trigger api-go update (#407)

Replace GHA token in workflow to trigger api-go update (#407) #130

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
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 }}
COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }}
COMMIT_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
gh workflow run update-proto.yml -R https://github.com/temporalio/api-go \
-r master \
-f commit_author="${COMMIT_AUTHOR}" \
-f commit_author_email="${COMMIT_AUTHOR_EMAIL}" \
-f commit_message="${COMMIT_MESSAGE}"