Skip to main content

Crate monochange_github

Crate monochange_github 

Source
Expand description

§monochange_github

monochange_github turns monochange release manifests into GitHub automation requests.

Reach for this crate when you want to preview or publish GitHub releases and release pull requests using the same structured release data that powers changelog files and release manifests.

§Why use it?

  • derive GitHub release payloads and release-PR bodies from monochange’s structured release manifest
  • keep GitHub automation aligned with changelog rendering and release targets
  • reuse one publishing path for dry-run previews and real repository updates

§Best for

  • building GitHub release automation on top of mc release
  • previewing would-be GitHub releases and release PRs in CI before publishing
  • converting grouped or package release targets into repository automation payloads

§Public entry points

  • build_release_requests(config, manifest) converts a release manifest into GitHub release requests
  • publish_release_requests(requests) publishes requests through the GitHub API via octocrab
  • build_release_pull_request_request(config, manifest) converts a release manifest into a GitHub release-PR request
  • publish_release_pull_request(root, request, tracked_paths) creates or updates a release PR through git and the GitHub API

§Example

use monochange_core::ProviderBotSettings;
use monochange_core::ProviderMergeRequestSettings;
use monochange_core::ProviderReleaseSettings;
use monochange_core::SourceConfiguration;
use monochange_core::SourceProvider;
use monochange_core::ReleaseManifest;
use monochange_core::ReleaseManifestPlan;
use monochange_core::ReleaseManifestTarget;
use monochange_core::ReleaseOwnerKind;
use monochange_core::VersionFormat;
use monochange_github::build_release_requests;

let manifest = ReleaseManifest {
    command: "release".to_string(),
    dry_run: true,
    version: Some("1.2.0".to_string()),
    group_version: Some("1.2.0".to_string()),
    release_targets: vec![ReleaseManifestTarget {
        id: "sdk".to_string(),
        kind: ReleaseOwnerKind::Group,
        version: "1.2.0".to_string(),
        tag: true,
        release: true,
        version_format: VersionFormat::Primary,
        tag_name: "v1.2.0".to_string(),
        members: vec!["core".to_string(), "app".to_string()],
        rendered_title: "1.2.0 (2026-04-06)".to_string(),
        rendered_changelog_title: "[1.2.0](https://example.com) (2026-04-06)".to_string(),
    }],
    released_packages: vec!["workflow-core".to_string(), "workflow-app".to_string()],
    changed_files: Vec::new(),
    changesets: Vec::new(),
    changelogs: Vec::new(),
    deleted_changesets: Vec::new(),
    plan: ReleaseManifestPlan {
        workspace_root: std::path::PathBuf::from("."),
        decisions: Vec::new(),
        groups: Vec::new(),
        warnings: Vec::new(),
        unresolved_items: Vec::new(),
        compatibility_evidence: Vec::new(),
    },
};
let github = SourceConfiguration {
    provider: SourceProvider::GitHub,
    owner: "ifiokjr".to_string(),
    repo: "monochange".to_string(),
    host: None,
    api_url: None,
    releases: ProviderReleaseSettings::default(),
    pull_requests: ProviderMergeRequestSettings::default(),
    bot: ProviderBotSettings::default(),
};

let requests = build_release_requests(&github, &manifest);

assert_eq!(requests.len(), 1);
assert_eq!(requests[0].tag_name, "v1.2.0");
assert_eq!(requests[0].repository, "ifiokjr/monochange");

Structs§

GitHubHostedSourceAdapter
Hosted-source adapter for GitHub repositories.

Statics§

HOSTED_SOURCE_ADAPTER
Shared GitHub hosted-source adapter instance used by the workspace.

Functions§

annotate_changeset_context
Apply GitHub URLs and provider metadata without making remote API calls.
build_release_pull_request_request
Build the release pull request request for the configured GitHub repository.
build_release_requests
Convert releasable targets into provider-specific GitHub release requests.
comment_released_issues
Create release comments on linked GitHub issues when they have not been posted yet.
compare_url
URL comparing two tags on the GitHub repository.
enrich_changeset_context
Enrich changeset context with remote GitHub review-request and issue data.
github_commit_url
Build a web URL for a commit on the configured GitHub repository.
github_host
Extract the host name used for rendered GitHub links.
github_hosting_capabilities
Return the hosting metadata features available from GitHub changeset context.
github_issue_url
Build a web URL for an issue on the configured GitHub repository.
github_pull_request_url
Build a web URL for a pull request on the configured GitHub repository.
github_web_base_url
Return the GitHub web base URL for building browser links.
plan_released_issue_comments
Plan release comments for issues that are closed by the manifest’s review requests.
publish_release_pull_request
Commit, push, and publish the release pull request against GitHub.
publish_release_requests
Publish or update all planned GitHub releases for a manifest.
source_capabilities
Return the hosted-source capabilities supported by the GitHub provider.
sync_retargeted_releases
Sync existing GitHub releases so retargeted tags point at the new commits.
tag_url
URL to a specific tag on the GitHub repository.
validate_source_configuration
Validate that a source configuration is compatible with the GitHub provider.

Type Aliases§

GitHubIssueCommentOperation
Shared issue-comment operation type for GitHub issue release comments.
GitHubIssueCommentOutcome
Shared issue-comment outcome type for GitHub issue release comments.
GitHubIssueCommentPlan
Shared issue-comment planning type for GitHub issue release comments.
GitHubPullRequestOperation
GitHubPullRequestOutcome
GitHubPullRequestRequest
GitHubReleaseOperation
GitHubReleaseOutcome
GitHubReleaseRequest