Skip to content

Commit 28e4391

Browse files
author
mafyuh
committedJul 31, 2024
Update .forgejo/workflows/CD.yml
1 parent 7bca24e commit 28e4391

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed
 

‎.forgejo/workflows/CD.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
deploy:
88
if: github.event.pull_request.merged == true
9-
runs-on: docker
9+
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout repository
1212
uses: actions/checkout@v4
@@ -85,13 +85,10 @@ jobs:
8585
8686
sleep 45 # Delay for 45 seconds before fetching logs
8787
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+
9091
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')"
9592
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

0 commit comments

Comments
 (0)
Please sign in to comment.