Skip to content

Commit 7f05397

Browse files
authored
fix gh actions files changed (#5)
* fix gh actions files changed * fix webhook url * setup webhook env
1 parent ffc6ebf commit 7f05397

File tree

2 files changed

+36
-38
lines changed

2 files changed

+36
-38
lines changed

.github/workflows/files-changed.yaml

-38
This file was deleted.

.github/workflows/files-changed.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: File Change Webhook
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
paths:
8+
- "specs/*"
9+
10+
jobs:
11+
notify:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Get Changed Files
18+
id: changes
19+
shell: bash
20+
run: |
21+
#files_changed=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | cut -c 7- | cut -c -5)
22+
echo "Files changed: $files_changed"
23+
echo "CHANGED_FILES=$files_changed" >> "$GITHUB_OUTPUT"
24+
25+
- name: Send Webhook
26+
shell: bash
27+
env:
28+
CHANGED_FILES: ${{ steps.changes.outputs.CHANGED_FILES }}
29+
WEBHOOK: ${{ secrets.WEBHOOK_URL }}
30+
run: |
31+
echo "Processing webhooks for..."
32+
echo $CHANGED_FILES
33+
for file in $CHANGED_FILES; do
34+
echo "Processing file: $file"
35+
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST "$WEBHOOK/$file"
36+
done

0 commit comments

Comments
 (0)