Skip to main content

Crate pinner

Crate pinner 

Source
Expand description

§Pinner Library

pinner is a library for hash-pinning GitHub Actions in workflow files. It provides tools to scan YAML workflows and replace mutable tags with immutable commit SHAs.

§Core Components

§Example

use pinner::{Operations, ReqwestGithubProvider, Cli, Commands};
use std::sync::Arc;
use std::path::PathBuf;

#[tokio::main]
async fn main() {
    let github = ReqwestGithubProvider::default();
    let ops = Operations::new(Arc::new(github), true, false, false);
    ops.pin(&[PathBuf::from(".github/workflows")]).await.unwrap();
}

Structs§

Cli
Command line arguments structure.
Operations
Orchestrator for pinning operations.
ReqwestGithubProvider
Default implementation of GithubProvider using reqwest.

Enums§

Commands
Subcommands for the Pinner CLI.
PinnerError
Custom error type for Pinner operations.

Traits§

GithubProvider
Trait for interacting with the GitHub API.

Functions§

run
Runs the Pinner CLI logic.