-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloud-schedule.ts
More file actions
62 lines (57 loc) · 1.65 KB
/
cloud-schedule.ts
File metadata and controls
62 lines (57 loc) · 1.65 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* cloud-schedule.ts
*
* Intended registration of prpm-hygiene as a scheduled workflow in
* AgentWorkforce/cloud. Not active yet — the cloud SDK is not published.
* This file documents the expected shape so the registration is ready
* when cloud lands.
*/
// import { Cloud } from '@agentworkforce/cloud-sdk' // not yet published
interface ScheduleSketch {
name: string
source: {
repo: string
ref: string
path: string
}
// This workflow is special: it targets *many* repos. Cloud will resolve
// the list from repos.txt in the source repo and clone each one into
// the workflow's working directory before execution.
targets: {
repoListPath: string
org: string
}
env: Record<string, string>
schedule: string // cron expression
timeoutMs: number
}
const schedule: ScheduleSketch = {
name: 'prpm-hygiene-weekly',
source: {
repo: 'AgentWorkforce/workflows',
ref: 'main',
path: 'repeatable/prpm-hygiene/workflow.ts',
},
targets: {
repoListPath: 'repeatable/prpm-hygiene/repos.txt',
org: 'AgentWorkforce',
},
env: {
DRY_RUN: 'false',
},
// Every Monday at 8am UTC
schedule: '0 8 * * 1',
timeoutMs: 3_600_000,
}
async function register() {
// const cloud = new Cloud({ apiKey: process.env.CLOUD_API_KEY! })
// await cloud.schedules.create(schedule)
console.log('cloud SDK not yet wired up — intended schedule:')
console.log(` ${schedule.name}: ${schedule.schedule}`)
console.log(` source: ${schedule.source.repo}/${schedule.source.path}`)
console.log(` targets: listed in ${schedule.targets.repoListPath}`)
}
register().catch((err) => {
console.error(err)
process.exit(1)
})