This repository has been archived on 2024-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
Auto-Homelab/.forgejo/workflows/get-logs.yml

19 lines
573 B
YAML
Raw Normal View History

2024-06-09 20:36:33 -04:00
---
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/