Add .forgejo/workflows/get-logs.yml
This commit is contained in:
parent
aeb77d74ca
commit
d39f29e20c
1 changed files with 18 additions and 0 deletions
18
.forgejo/workflows/get-logs.yml
Normal file
18
.forgejo/workflows/get-logs.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
name: Get AWX Job Logs
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
name: get-logs-trigger
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
fetch-logs:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- name: Get AWX Job Logs
|
||||||
|
run: |
|
||||||
|
# Fetch the most recent job from AWX
|
||||||
|
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')
|
||||||
|
|
||||||
|
# Fetch the logs for the job
|
||||||
|
curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" https://awx.mafyuh.xyz/api/v2/jobs/$job_id/stdout/
|
Reference in a new issue