1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# To use this workflow, you need to install the GitHub App (tamada-pipline-bot).
# The App is already installed for repositories owned by tamada,
# so you don't need to do anything for those.
# You also need to set APP_ID and APP_PRIVATE_KEY in the GitHub Actions Secrets.
# - CLIENT_ID can be found in the GitHub App settings.
# - APP_PRIVATE_KEY can be generated in the GitHub App settings.
name: notify-publish
on:
release:
types:
workflow_dispatch:
# This workflow uses the token of the GitHub App, not the GITHUB_TOKEN.
permissions:
jobs:
notify:
runs-on: ubuntu-latest
steps:
# Generate a one-time token using the private key
- name: Generate Token
id: generate_token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
# Fire the workflow for the other repository using the generated token
- name: Trigger API Repository
run: |
gh workflow run "deploy.yml" \
--repo "tamada/api" \
-f repo=${{ github.repository }} \
-f update_brew=true
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}