github-actions 0.0.6

Utilities for developing custom GitHub Actions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::time::{SystemTime, UNIX_EPOCH};

pub(crate) fn random_id() -> String {
    let now = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .unwrap()
        .as_nanos();
    let addr = &now as *const u128 as usize;
    format!("{:x}-{:x}", now, addr)
}

pub(crate) fn delimiter() -> String {
    format!("ghadelimiter_{}", random_id())
}