Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T06:41:36.356Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

danger.rs

58 lines · 2.0 KB · rust
1use gh_workflow::*;
2
3use crate::tasks::workflows::steps::{CommonJobConditions, CommonPermissionSets, NamedJob, named};
4
5use super::{runners, steps};
6
7/// Generates the danger.yml workflow
8pub fn danger() -> Workflow {
9    let danger = danger_job();
10
11    named::workflow()
12        .with_minimal_permissions()
13        .on(Event::default()
14            .pull_request(PullRequest::default().add_branch("main").types([
15                PullRequestType::Opened,
16                PullRequestType::Synchronize,
17                PullRequestType::Reopened,
18                PullRequestType::Edited,
19            ]))
20            .merge_group(MergeGroup::default()))
21        .add_job(danger.name, danger.job)
22}
23
24fn danger_job() -> NamedJob {
25    pub fn install_deps() -> Step<Run> {
26        named::bash("pnpm install --dir script/danger")
27    }
28
29    pub fn run() -> Step<Run> {
30        named::bash("pnpm run --dir script/danger danger ci")
31            // This GitHub token is not used, but the value needs to be here to prevent
32            // Danger from throwing an error.
33            .add_env(("GITHUB_TOKEN", "not_a_real_token"))
34            // All requests are instead proxied through a proxy that allows Danger to securely authenticate with GitHub
35            // while still being able to run on PRs from forks.
36            .add_env((
37                "DANGER_GITHUB_API_BASE_URL",
38                "https://danger-proxy.zed.dev/github",
39            ))
40    }
41
42    NamedJob {
43        name: "danger".to_string(),
44        job: Job::default()
45            .with_repository_owner_guard()
46            .runs_on(runners::LINUX_SMALL)
47            .add_step(steps::checkout_repo())
48            .add_step(steps::setup_pnpm())
49            .add_step(
50                steps::setup_node()
51                    .add_with(("cache", "pnpm"))
52                    .add_with(("cache-dependency-path", "script/danger/pnpm-lock.yaml")),
53            )
54            .add_step(install_deps())
55            .add_step(run()),
56    }
57}
58
Served at tenant.openagents/omega Member data and write actions are omitted.