Skip to content

Commit e3adb56

Browse files
committed
Fixes to webhook github actions
1 parent 154a544 commit e3adb56

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/files-changed.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
id: changes
1919
shell: bash
2020
run: |
21-
files_changed=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | cut -c 7- | cut -c -5)
21+
files_changed=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }})
2222
echo "Files changed: $files_changed"
2323
echo "CHANGED_FILES=$files_changed" >> "$GITHUB_OUTPUT"
2424
@@ -29,8 +29,12 @@ jobs:
2929
WEBHOOK: ${{ secrets.WEBHOOK_URL }}
3030
run: |
3131
echo "Processing webhooks for..."
32-
echo $CHANGED_FILES
33-
for file in $CHANGED_FILES; do
32+
echo "$CHANGED_FILES"
33+
for file in "$CHANGED_FILES"; do
3434
echo "Processing file: $file"
35-
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST "$WEBHOOK/$file"
35+
filename=$(basename "$file")
36+
filename_without_ext="${filename%.*}"
37+
echo "Completed processing of $filename_without_ext. Now sending copr webhook of package $filename_without_ext"
38+
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST "$WEBHOOK/$filename_without_ext"
39+
sleep 5
3640
done

0 commit comments

Comments
 (0)