Add parent workflow info to visibility schema (#5054) #1956
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: 'Trigger Docker image build' | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
jobs: | |
trigger: | |
name: 'trigger Docker image build' | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Get git branch name | |
id: get_branch | |
run: | | |
echo "::set-output name=branch::${GITHUB_REF#refs/heads/}" | |
- name: Generate a token | |
id: generate_token | |
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 | |
with: | |
app_id: ${{ secrets.TEMPORAL_CICD_APP_ID }} | |
private_key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }} | |
- name: Dispatch docker builds Github Action | |
env: | |
PAT: ${{ steps.generate_token.outputs.token }} | |
PARENT_REPO: temporalio/docker-builds | |
PARENT_BRANCH: ${{ toJSON('main') }} | |
WORKFLOW_ID: update-submodules.yml | |
REPO: ${{ toJSON('temporal') }} | |
BRANCH: ${{ toJSON(steps.get_branch.outputs.branch) }} | |
run: | | |
curl -fL -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token $PAT" "https://api.github.com/repos/$PARENT_REPO/actions/workflows/$WORKFLOW_ID/dispatches" -d '{"ref":'"$PARENT_BRANCH"', "inputs": { "repo":'"$REPO"', "branch":'"$BRANCH"' }}' |