chore: trigger update #6
This file contains hidden or 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 api-go Update' | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: "Branch in api-go repo to trigger update protos (default: master)" | |
| required: true | |
| default: master | |
| 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.RR_CICD_APP_ID }} | |
| private-key: ${{ secrets.RR_CICD_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: api-go | |
| - name: Dispatch api-go Github Action | |
| env: | |
| GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| EVENT_PUSH_BRANCH: ${{ github.event.ref }} | |
| EVENT_PUSH_COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }} | |
| EVENT_PUSH_COMMIT_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }} | |
| EVENT_PUSH_COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
| EVENT_WF_DISPATCH_BRANCH: ${{ github.event.inputs.branch }} | |
| run: | | |
| case "${{ github.event_name }}" in | |
| "push") | |
| BRANCH="${EVENT_PUSH_BRANCH#refs/heads/}" | |
| COMMIT_AUTHOR="${EVENT_PUSH_COMMIT_AUTHOR}" | |
| COMMIT_AUTHOR_EMAIL="${EVENT_PUSH_COMMIT_AUTHOR_EMAIL}" | |
| COMMIT_MESSAGE="${EVENT_PUSH_COMMIT_MESSAGE}" | |
| ;; | |
| "workflow_dispatch") | |
| BRANCH="${EVENT_WF_DISPATCH_BRANCH}" | |
| COMMIT_AUTHOR="RoadRunner Bot" | |
| COMMIT_AUTHOR_EMAIL="bot@roadrunner.dev" | |
| COMMIT_MESSAGE="Update proto" | |
| ;; | |
| esac | |
| gh workflow run update-proto.yml \ | |
| -R roadrunner-server/api-go \ | |
| -r master \ | |
| -f branch="${BRANCH}" \ | |
| -f commit_author="${COMMIT_AUTHOR}" \ | |
| -f commit_author_email="${COMMIT_AUTHOR_EMAIL}" \ | |
| -f commit_message="${COMMIT_MESSAGE}" |