Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 06c386c

Browse files
committed
bugfix: make action names optional
The docs claim that `name` is required, but it is not. Signed-off-by: William Woodruff <[email protected]>
1 parent e6e7829 commit 06c386c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "github-actions-models"
33
authors = ["William Woodruff <[email protected]>"]
44
description = "Unofficial, high-quality data models for GitHub Actions workflows, actions, and related components"
5-
version = "0.22.0"
5+
version = "0.23.0"
66
edition = "2021"
77
license = "MIT"
88
repository = "https://github.com/woodruffw/github-actions-models"

src/action.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ use crate::common::{
1919
#[derive(Deserialize)]
2020
#[serde(rename_all = "kebab-case")]
2121
pub struct Action {
22-
pub name: String,
22+
/// The action's name.
23+
///
24+
/// NOTE: GitHub documents the action's name as required, but experimentally it is not.
25+
pub name: Option<String>,
2326
pub author: Option<String>,
2427
pub description: Option<String>,
2528
#[serde(default)]

tests/test_action.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn test_load_all() {
2828
fn test_setup_python() {
2929
let setup_python = load_action("setup-python.yml");
3030

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

0 commit comments

Comments
 (0)