stow_types/
trusted_builder.rs1macro_rules! repository {
11 () => {
12 "water-rs/stow"
13 };
14}
15macro_rules! workflow_file {
16 () => {
17 "build-crate.yml"
18 };
19}
20macro_rules! index_workflow_file {
21 () => {
22 "index-publish.yml"
23 };
24}
25macro_rules! branch {
26 () => {
27 "main"
28 };
29}
30
31pub const REPOSITORY: &str = repository!();
33pub const WORKFLOW_FILE: &str = workflow_file!();
35pub const BRANCH: &str = branch!();
38pub const CERTIFICATE_IDENTITY: &str = concat!(
40 "https://github.com/",
41 repository!(),
42 "/.github/workflows/",
43 workflow_file!(),
44 "@refs/heads/",
45 branch!()
46);
47pub const CERTIFICATE_ISSUER: &str = "https://token.actions.githubusercontent.com";
49
50pub const INDEX_WORKFLOW_FILE: &str = index_workflow_file!();
53pub const INDEX_CERTIFICATE_IDENTITY: &str = concat!(
59 "https://github.com/",
60 repository!(),
61 "/.github/workflows/",
62 index_workflow_file!(),
63 "@refs/heads/",
64 branch!()
65);
66
67#[cfg(test)]
68mod tests {
69 use super::{CERTIFICATE_IDENTITY, INDEX_CERTIFICATE_IDENTITY};
70
71 #[test]
72 fn certificate_identity_composes_repository_workflow_and_ref() {
73 assert_eq!(
74 CERTIFICATE_IDENTITY,
75 "https://github.com/water-rs/stow/.github/workflows/build-crate.yml@refs/heads/main"
76 );
77 }
78
79 #[test]
80 fn index_certificate_identity_composes_repository_workflow_and_ref() {
81 assert_eq!(
82 INDEX_CERTIFICATE_IDENTITY,
83 "https://github.com/water-rs/stow/.github/workflows/index-publish.yml@refs/heads/main"
84 );
85 }
86}