Skip to content

Commit 5c43cb8

Browse files
authored
Add add_pr_comment action (#69)
1 parent b6f560f commit 5c43cb8

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Add PR Comment
2+
description: Adds a PR comment on an open PR in another repository
3+
inputs:
4+
username:
5+
required: true
6+
description: Github Username
7+
token:
8+
required: true
9+
description: Github Password
10+
repo-name:
11+
required: true
12+
description: The name of the repository the comment is being made in
13+
pr-number:
14+
required: true
15+
description: Pull Request or Issue Number from api-specs repo
16+
message:
17+
required: true
18+
description: The message to be used as the PR comment
19+
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Make PR Comment
24+
run: |
25+
curl \
26+
-X POST \
27+
-H "Accept: application/vnd.github.v3+json" \
28+
https://api.github.com/repos/Bandwidth/${{ inputs.repo-name }}/issues/${{ inputs.pr-number }}/comments \
29+
-u ${{ inputs.username }}:${{ inputs.token }} \
30+
-d '{"body": "${{ inputs.message }}"}'
31+
shell: bash

.github/workflows/listener.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
exists=$(hub pr list -h {{ inputs.branch-name }})
3636
if [ -z "$exists" ]
3737
then
38-
hub pull-request --base Bandwidth:main -m '${{ github.event.client_payload.branchName }}' -m 'Generate SDK with Upstream API Spec Changes\n\nOpened By: ${{ github.event.client_payload.author }}'
38+
hub pull-request --base Bandwidth:main -m '${{ github.event.client_payload.branchName }}' -m 'Generate SDK with Upstream API Spec Changes. Opened By: @${{ github.event.client_payload.author }}'
3939
else
4040
echo "PR already exists for this branch"
4141
fi

0 commit comments

Comments
 (0)