-
Notifications
You must be signed in to change notification settings - Fork 11
35 lines (35 loc) · 1.19 KB
/
reusable-workflows.yml
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
name: Reusable Workflows
on:
workflow_call: # Reusable Workflowsを起動するイベント
inputs: # Reusable Workflowsの入力パラメータ定義(平文)
pr-number:
type: string
default: ${{ github.event.pull_request.number }}
required: false
description: プルリクエスト番号
secrets: # Reusable Workflowsの入力パラメータ定義(Secrets)
token:
required: true
description: GitHubトークン
outputs: # Reusable Workflowsの出力値定義
message:
value: ${{ jobs.comment.outputs.pr-comment }}
description: メッセージ
jobs: # Reusable Workflowsのジョブ定義
comment:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- id: pr-comment
run: |
body="Welcome, ${GITHUB_ACTOR}"
gh pr comment "${PR_NUMBER}" --body "${body}"
echo "body=${body}" >>"${GITHUB_OUTPUT}"
env:
PR_NUMBER: ${{ inputs.pr-number }}
GITHUB_TOKEN: ${{ secrets.token }}
outputs:
pr-comment: ${{ steps.pr-comment.outputs.body }}