File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 14
14
- name : Fetch all history for git diff
15
15
run : git fetch --depth=2
16
16
17
+ - name : Install jq
18
+ run : |
19
+ apt-get update && apt-get install -y jq
20
+
17
21
- name : Detect modified folders
18
22
id : detect-changes
19
23
run : |
@@ -85,10 +89,13 @@ jobs:
85
89
86
90
sleep 45 # Delay for 45 seconds before fetching logs
87
91
88
- job_id=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" "https://awx.mafyuh.xyz/api/v2/job_templates/13/jobs/?order_by=-id" | grep -oP '"id":\s*\K[0-9]+')
89
- logs=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" "https://awx.mafyuh.xyz/api/v2/jobs/$job_id/stdout/?format=json")
90
-
92
+ job_id=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" https://awx.mafyuh.xyz/api/v2/job_templates/13/jobs/?order_by=-id | jq -r '.results[0].id')
93
+ logs=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" https://awx.mafyuh.xyz/api/v2/jobs/$job_id/stdout/?format=json)
91
94
echo "AWX Job Logs for folder: $folder"
95
+ echo "Range:"
96
+ echo "Start: $(echo "$logs" | jq -r '.range.start')"
97
+ echo "End: $(echo "$logs" | jq -r '.range.end')"
98
+ echo "Absolute End: $(echo "$logs" | jq -r '.range.absolute_end')"
92
99
echo "Content:"
93
- echo "$logs" | grep -oP '" content":\s*"\K[^"]+' | sed 's/\\n/\n/g'
100
+ echo "$(echo "$ logs" | jq -r '. content')"
94
101
done
You can’t perform that action at this time.
0 commit comments