[internal] Produce data for external analysis #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[internal] Produce data for external analysis" | |
on: | |
workflow_call: | |
workflow_dispatch: | |
inputs: | |
test_workflow_run_id: | |
description: "Unique GitHub workflow run ID to use for data" | |
default: 9612854120 | |
type: number | |
workflow_run: | |
workflows: | |
- "Build" | |
- "(post-commit) all - Static checks, linters etc." | |
- "All post-commit workflows" | |
types: | |
- completed | |
jobs: | |
produce-data: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Output auxiliary values (workflow dispatch) | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
echo "[Info] Workflow run attempt" | |
gh api /repos/${{ github.action_repository }}/actions/runs/${{ inputs.test_workflow_run_id }}/attempts/1 | |
gh api /repos/${{ github.action_repository }}/actions/runs/${{ inputs.test_workflow_run_id }}/attempts/1 > workflow.json | |
echo "[Info] Workflow run attempt jobs" | |
gh api --paginate /repos/${{ github.action_repository }}/actions/runs/${{ inputs.test_workflow_run_id }}/attempts/1/jobs | |
gh api --paginate /repos/${{ github.action_repository }}/actions/runs/${{ inputs.test_workflow_run_id }}/attempts/1/jobs > workflow_jobs.json | |
- name: Output auxiliary values (workflow_run completed) | |
if: ${{ github.event_name == 'workflow_run' }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
echo "[Info] Workflow run attempt" | |
gh api /repos/${{ github.action_repository }}/actions/runs/${{ github.event.workflow_run.id }}/attempts/${{ github.event.workflow_run.run_attempt }} > workflow.json | |
echo "[Info] Workflow run attempt jobs" | |
gh api --paginate /repos/${{ github.action_repository }}/actions/runs/${{ github.event.workflow_run.id }}/attempts/${{ github.event.workflow_run.run_attempt }}/jobs > workflow_jobs.json | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
workflow.json | |
workflow_jobs.json |