Skip to content

Commit 1f181b7

Browse files
committed
adding github action to update meta repo
1 parent ce397aa commit 1f181b7

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Trigger Meta Repo Update
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- github-action-test # Instead of main
7+
types:
8+
- closed
9+
10+
jobs:
11+
trigger-meta-repo:
12+
if: github.event.pull_request.merged == true
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Send repository update event
17+
run: |
18+
curl -X POST -H "Authorization: token ${{ secrets.GH_PAT }}" \
19+
-H "Accept: application/vnd.github.v3+json" \
20+
https://api.github.com/repos/hubspotdev/CODE-Hub/actions/workflows/update-meta-repo.yml/dispatches \
21+
-d '{
22+
"ref": "main",
23+
"inputs": {
24+
"repo": "'"${{ github.repository }}"'",
25+
"commit": "'"${{ github.sha }}"'",
26+
"pr_title": "'"${{ github.event.pull_request.title }}"'",
27+
"pr_url": "'"${{ github.event.pull_request.html_url }}"'"
28+
}
29+
}'
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Trigger Meta Repo Update
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
8+
jobs:
9+
trigger-meta-repo:
10+
if: github.event.pull_request.merged == true
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Send repository update event
15+
run: |
16+
curl -X POST -H "Authorization: token ${{ secrets.GH_PAT }}" \
17+
-H "Accept: application/vnd.github.v3+json" \
18+
https://api.github.com/repos/hubspotdev/CODE-Hub/dispatches \
19+
-d '{
20+
"event_type": "update-meta-repo",
21+
"client_payload": {
22+
"repo": "'"${{ github.repository }}"'",
23+
"commit": "'"${{ github.sha }}"'",
24+
"pr_title": "'"${{ github.event.pull_request.title }}"'",
25+
"pr_url": "'"${{ github.event.pull_request.html_url }}"'"
26+
}
27+
}'

0 commit comments

Comments
 (0)