Skip to content

Commit db9b544

Browse files
authored
Update workflows
1 parent 09f5fd8 commit db9b544

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/files-changed.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: File Change Webhook
2+
3+
on:
4+
push:
5+
paths:
6+
- 'specs/*'
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Get Changed Files
15+
id: changes
16+
run: |
17+
git diff-tree --no-commit-id --name-only -r ${{ github.sha }} > changed_files.txt
18+
echo "::set-output name=files::$(cat changed_files.txt)"
19+
20+
- name: Send Webhook for Each File
21+
run: |
22+
for file in $(cat changed_files.txt); do
23+
filename=$(basename "$file")
24+
name_without_extension="${filename%.*}"
25+
curl -X POST "${{ secrets.WEBHOOK_URL }}/$name_without_extension" -d "{\"filename\":\"$name_without_extension\"}" -H "Content-Type: application/json"
26+
done

0 commit comments

Comments
 (0)