1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! ghactions-derive is a library that provides derive macros for GitHub Actions in Rust.
//!
//! # Example
//!
//! ```no_run
//! use ghactions::prelude::*;
//!
//! #[derive(Actions, Debug, Clone)]
//! #[action(
//! path = "./action.yml",
//! name = "My Action",
//! description = "My Action Description"
//! )]
//! pub struct MyAction {
//! /// My Input
//! #[input(
//! description = "My Input",
//! default = "false"
//! )]
//! my_input: bool,
//!
//! #[input(
//! name = "custom",
//! description = "My Custom Input",
//! )]
//! my_custom: String,
//!
//! #[input(
//! description = "Multi Input",
//! split = ",",
//! )]
//! multi_input: Vec<String>,
//!
//! #[output(description = "Output Value")]
//! my_output: String,
//! }
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let action = MyAction::init()?;
//!
//! println!("My Input :: {}", action.my_input);
//!
//! # assert_eq!(action.my_input, false);
//! # assert_eq!(action.my_custom, "Custom Value");
//! # assert_eq!(action.multi_input, vec!["this".to_string(), "is".to_string(), "a".to_string(), "test".to_string()]);
//!
//! MyAction::set_output("my_output", "My Output Value")?;
//!
//! Ok(())
//! }
//! ```
extern crate proc_macro;
extern crate proc_macro2;
extern crate quote;
extern crate syn;
use TokenStream;
use ;
/// Derive macro for GitHub Actions