File tree 1 file changed +6
-24
lines changed
1 file changed +6
-24
lines changed Original file line number Diff line number Diff line change @@ -16,40 +16,22 @@ 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
20
19
echo "FILES=$(cat changed_files.txt)" >> $GITHUB_ENV
21
-
22
- - name : Print Changed Files
23
- run : echo $FILES
24
- env :
25
- FILES : ${{ env.FILES }}
26
20
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
- }
21
+ - name : Print Changed Files
22
+ run : |
23
+ echo $FILES
43
24
env :
44
25
FILES : ${{ env.FILES }}
45
26
46
- - name : Echo Filename
27
+ - name : Echo Filename and Send Webhook
47
28
run : |
48
- for file in $FILES; do
29
+ for file in ${{ env. FILES }} ; do
49
30
filename=$(basename "$file")
50
31
name_without_extension="${filename%.*}"
51
32
echo "Processing file: $filename"
52
33
echo "Sending webhook for $name_without_extension"
34
+ gh workflow run infraway/workflow-webhook-action --with webhook_url=${{ secrets.WEBHOOK_URL }} --with method=POST --with payload='{"filename":"'"$filename"'","name_without_extension":"'"$name_without_extension"'"}'
53
35
done
54
36
env :
55
37
FILES : ${{ env.FILES }}
You can’t perform that action at this time.
0 commit comments