Skip to content

Commit

Permalink
bugfix: make action names optional
Browse files Browse the repository at this point in the history
The docs claim that `name` is required, but it is not.

Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw committed Jan 24, 2025
1 parent e6e7829 commit 06c386c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "github-actions-models"
authors = ["William Woodruff <[email protected]>"]
description = "Unofficial, high-quality data models for GitHub Actions workflows, actions, and related components"
version = "0.22.0"
version = "0.23.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/woodruffw/github-actions-models"
Expand Down
5 changes: 4 additions & 1 deletion src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ use crate::common::{
#[derive(Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Action {
pub name: String,
/// The action's name.
///
/// NOTE: GitHub documents the action's name as required, but experimentally it is not.
pub name: Option<String>,
pub author: Option<String>,
pub description: Option<String>,
#[serde(default)]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn test_load_all() {
fn test_setup_python() {
let setup_python = load_action("setup-python.yml");

assert_eq!(setup_python.name, "Setup Python");
assert_eq!(setup_python.name.as_deref(), Some("Setup Python"));
assert_eq!(
setup_python.description.unwrap(),
"Set up a specific version of Python and add the command-line tools to the PATH."
Expand Down

0 comments on commit 06c386c

Please sign in to comment.