Skip to content

Commit 0312fe3

Browse files
authored
chore: Modify workflow to add PR's author and URL to the event payload (#965)
1 parent 5435b47 commit 0312fe3

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
name: Dispatch Developer Hub Workflow
1+
name: Dispatch Developer Hub on PR merge
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
pull_request:
5+
types: [closed]
76

87
jobs:
98
dispatch:
9+
# Only run this job if the pull request was merged into the main branch
10+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
1011
runs-on: ubuntu-latest
1112
steps:
1213
- name: Send repository_dispatch to phrase/developer-hub
@@ -15,4 +16,10 @@ jobs:
1516
token: ${{ secrets.DISPATCH_DEVELOPER_HUB_TOKEN }}
1617
repository: phrase/developer-hub
1718
event-type: trigger-strings-workflow
18-
client-payload: '{"source": "phrase/openapi", "type": "update"}'
19+
client-payload: >-
20+
{
21+
"source": "phrase/openapi",
22+
"type": "update",
23+
"pr_author": "${{ github.event.pull_request.user.login }}",
24+
"pr_url": "${{ github.event.pull_request.html_url }}"
25+
}

0 commit comments

Comments
 (0)