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
Operations: The main orchestrator for pinning, upgrading, and setting action hashes.GithubProvider: A trait for fetching commit SHAs and latest releases from GitHub.ReqwestGithubProvider: The default implementation ofGithubProviderusingreqwest.
§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.
- Reqwest
Github Provider - Default implementation of
GithubProviderusingreqwest.
Enums§
- Commands
- Subcommands for the Pinner CLI.
- Pinner
Error - Custom error type for Pinner operations.
Traits§
- Github
Provider - Trait for interacting with the GitHub API.
Functions§
- run
- Runs the Pinner CLI logic.