-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 2.06 KB
/
_produce-data.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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