Skip to content

Commit 41cf995

Browse files
Add workflow to notify profile stats updates
1 parent 49fe5f1 commit 41cf995

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Notify profile stats updater
2+
3+
on:
4+
push:
5+
branches:
6+
- "**" # ou restrinja para main/master se quiser
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
notify:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Dispatch update to profile repo
17+
env:
18+
PROFILE_REPO: fernandoncidade/fernandoncidade
19+
EVENT_TYPE: repo-push
20+
GH_TOKEN: ${{ secrets.PROFILE_DISPATCH_TOKEN }}
21+
run: |
22+
set -euo pipefail
23+
24+
# Dispara repository_dispatch no repo do perfil
25+
curl -sS -X POST \
26+
-H "Accept: application/vnd.github+json" \
27+
-H "Authorization: Bearer ${GH_TOKEN}" \
28+
"https://api.github.com/repos/${PROFILE_REPO}/dispatches" \
29+
-d "$(jq -nc \
30+
--arg event_type "${EVENT_TYPE}" \
31+
--arg repo "${GITHUB_REPOSITORY}" \
32+
--arg ref "${GITHUB_REF}" \
33+
--arg sha "${GITHUB_SHA}" \
34+
'{event_type:$event_type, client_payload:{repo:$repo, ref:$ref, sha:$sha}}' \
35+
)"

0 commit comments

Comments
 (0)