File tree 1 file changed +28
-2
lines changed
1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,40 @@ jobs:
16
16
id : changes
17
17
run : |
18
18
git diff-tree --no-commit-id --name-only -r ${{ github.sha }} > changed_files.txt
19
+ cat changed_files.txt
19
20
echo "FILES=$(cat changed_files.txt)" >> $GITHUB_ENV
20
21
22
+ - name : Print Changed Files
23
+ run : echo $FILES
24
+ env :
25
+ FILES : ${{ env.FILES }}
26
+
21
27
- name : Send Webhook for Each File
28
+ uses : infraway/workflow-webhook-action@v1
29
+ with :
30
+ webhook_url : ${{ secrets.WEBHOOK_URL }}
31
+ method : POST
32
+ payload : |
33
+ {
34
+ "files": [
35
+ ${{#each env.FILES.split(" ")}}
36
+ {
37
+ "filename": "${{this}}",
38
+ "name_without_extension": "${{this.replace(/\.[^/.]+$/, '')}}"
39
+ }${{#if @last}}{{else}},{{/if}}
40
+ ${{/each}}
41
+ ]
42
+ }
43
+ env :
44
+ FILES : ${{ env.FILES }}
45
+
46
+ - name : Echo Filename
22
47
run : |
23
- for file in $(echo $ FILES) ; do
48
+ for file in $FILES; do
24
49
filename=$(basename "$file")
25
50
name_without_extension="${filename%.*}"
26
- curl -X POST "${{ secrets.WEBHOOK_URL }}/$name_without_extension" -d "{\"filename\":\"$name_without_extension\"}" -H "Content-Type: application/json"
51
+ echo "Processing file: $filename"
52
+ echo "Sending webhook for $name_without_extension"
27
53
done
28
54
env :
29
55
FILES : ${{ env.FILES }}
You can’t perform that action at this time.
0 commit comments