File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 6
6
jobs :
7
7
deploy :
8
8
if : github.event.pull_request.merged == true
9
- runs-on : docker
9
+ runs-on : ubuntu-latest
10
10
steps :
11
11
- name : Checkout repository
12
12
uses : actions/checkout@v4
@@ -85,13 +85,10 @@ jobs:
85
85
86
86
sleep 45 # Delay for 45 seconds before fetching logs
87
87
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 | jq -r '.results[0].id')
89
- logs=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" https://awx.mafyuh.xyz/api/v2/jobs/$job_id/stdout/?format=json)
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
+
90
91
echo "AWX Job Logs for folder: $folder"
91
- echo "Range:"
92
- echo "Start: $(echo "$logs" | jq -r '.range.start')"
93
- echo "End: $(echo "$logs" | jq -r '.range.end')"
94
- echo "Absolute End: $(echo "$logs" | jq -r '.range.absolute_end')"
95
92
echo "Content:"
96
- echo "$(echo "$ logs" | jq -r '. content')"
97
- done
93
+ echo "$logs" | grep -oP '" content":\s*"\K[^"]+' | sed 's/\\n/\n/g'
94
+ done
You can’t perform that action at this time.
0 commit comments