Skip to content

Commit 1b7a9fb

Browse files
committed
Use webhook approach
1 parent fc52d04 commit 1b7a9fb

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed
Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Dispatch Roadmap Update
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types:
66
- labeled
77

@@ -13,23 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- name: Debug secret
16+
- name: Trigger Roadmap Update workflow
1717
run: |
18-
if [ -z "${{ secrets.PROJECT_TOKEN }}" ]; then
19-
echo "❌ PROJECT_TOKEN is not set"
20-
exit 1
21-
else
22-
echo "✅ PROJECT_TOKEN is present"
23-
fi
24-
- name: Trigger privileged workflow via repository_dispatch
25-
uses: peter-evans/repository-dispatch@v3
26-
with:
27-
token: ${{ secrets.PROJECT_TOKEN }}
28-
repository: ArmDeveloperEcosystem/arm-learning-paths
29-
event-type: update-project-dates
30-
client-payload: >-
31-
{
32-
"pr_number": ${{ github.event.pull_request.number }},
33-
"label": "${{ github.event.label.name }}",
34-
"repo": "${{ github.repository }}"
35-
}
18+
curl -X POST \
19+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
20+
-H "Accept: application/vnd.github+json" \
21+
https://api.github.com/repos/${{ github.repository }}/actions/workflows/roadmap-update.yml/dispatches \
22+
-d '{"ref": "${{ github.base_ref }}"}'

.github/workflows/roadmap-update.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Privileged Update Roadmap Dates
22

33
on:
4-
repository_dispatch:
5-
types: [update-project-dates]
4+
workflow_run:
5+
workflows: ["Dispatch Roadmap Update"]
6+
types:
7+
- completed
68

79
jobs:
810
update-project:

0 commit comments

Comments
 (0)