-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 1.16 KB
/
notify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Notify
on:
pull_request:
types: [closed]
jobs:
notify:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Determine version update type
id: determine_version
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=format:%B)
if [[ "$COMMIT_MESSAGE" == *"[major]"* ]]; then
echo "update_type=major" >> $GITHUB_ENV
elif [[ "$COMMIT_MESSAGE" == *"[minor]"* ]]; then
echo "update_type=minor" >> $GITHUB_ENV
else
echo "update_type=patch" >> $GITHUB_ENV
fi
- name: Send notification to style-forge
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.NOTIFY_GITHUB_TOKEN }}" \
https://api.github.com/repos/Style-Forge/hub/dispatches \
-d '{"event_type":"update-style-forge", "client_payload": {"update_type": "${{ env.update_type }}", "package_name": "style-forge.themes"}}'