1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "workflows": [
12 {
13 "owner_repo": "python/cpython",
14 "workflow_file": "stale.yml",
15 "expected_max_interval_minutes": 1440
16 },
17 {
18 "owner_repo": "home-assistant/core",
19 "workflow_file": "stale.yml",
20 "expected_max_interval_minutes": 1440
21 },
22 {
23 "owner_repo": "rust-lang/rust",
24 "workflow_file": "ghcr.yml",
25 "expected_max_interval_minutes": 2880
26 }
27 ],
28 "failureStreakThreshold": 2,
29 "alertWebhookUrl": "",
30 "runEventFilter": "schedule",
31 "runsPerWorkflow": 10,
32 "suppressRepeatAlerts": true,
33 "stateStoreName": "gha-schedule-monitor-state",
34 "confirmSilence": true,
35 "silenceConfirmDelaySeconds": 3,
36 "timeoutSeconds": 15,
37 "requestsPerSecond": 5,
38 "maxResponseBytes": 2000000
39};
40
41
42const run = await client.actor("kingii98/scheduled-github-actions-workflow-silence-and-failure-report").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52