From 26de2b45dead9c05a3bf3c407df6db5fbe4ddb55 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:06:00 +0000 Subject: [PATCH 1/3] fix: update on.command reference to on.slash-command in check_command_position Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/check_command_position.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/setup/js/check_command_position.cjs b/actions/setup/js/check_command_position.cjs index e945c7bbb44..f8128b85f7e 100644 --- a/actions/setup/js/check_command_position.cjs +++ b/actions/setup/js/check_command_position.cjs @@ -136,7 +136,7 @@ async function main() { core.setOutput("matched_command", ""); await writeDenialSummary( `The trigger comment did not start with a required command. Expected one of: ${expectedCommands}. Found: \`${firstWord}\`.`, - "Make sure the trigger comment starts with the required command defined in `on.command:` in the workflow frontmatter." + "Make sure the trigger comment starts with the required command defined in `on.slash-command:` in the workflow frontmatter." ); } } catch (error) { From 9819617327d2c094ff32b407b1b51b758bc25e19 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:15:42 +0000 Subject: [PATCH 2/3] fix: update all on.command references to on.slash-command Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/codemod_slash_command.go | 10 +++++----- pkg/cli/codemod_slash_command_test.go | 2 +- pkg/cli/fix_command_test.go | 2 +- pkg/workflow/frontmatter_extraction_yaml.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/cli/codemod_slash_command.go b/pkg/cli/codemod_slash_command.go index 0e3581237e6..4df877006e4 100644 --- a/pkg/cli/codemod_slash_command.go +++ b/pkg/cli/codemod_slash_command.go @@ -8,12 +8,12 @@ import ( var slashCommandCodemodLog = logger.New("cli:codemod_slash_command") -// getCommandToSlashCommandCodemod creates a codemod for migrating on.command to on.slash_command +// getCommandToSlashCommandCodemod creates a codemod for migrating on.command to on.slash-command func getCommandToSlashCommandCodemod() Codemod { return Codemod{ ID: "command-to-slash-command-migration", - Name: "Migrate on.command to on.slash_command", - Description: "Replaces deprecated 'on.command' field with 'on.slash_command'", + Name: "Migrate on.command to on.slash-command", + Description: "Replaces deprecated 'on.command' field with 'on.slash-command'", IntroducedIn: "0.2.0", Apply: func(content string, frontmatter map[string]any) (string, bool, error) { // Check if on.command exists @@ -62,7 +62,7 @@ func getCommandToSlashCommandCodemod() Codemod { if didReplace { result[i] = replacedLine modified = true - slashCommandCodemodLog.Printf("Replaced on.command with on.slash_command on line %d", i+1) + slashCommandCodemodLog.Printf("Replaced on.command with on.slash-command on line %d", i+1) } else { result[i] = line } @@ -73,7 +73,7 @@ func getCommandToSlashCommandCodemod() Codemod { return result, modified }) if applied { - slashCommandCodemodLog.Print("Applied on.command to on.slash_command migration") + slashCommandCodemodLog.Print("Applied on.command to on.slash-command migration") } return newContent, applied, err }, diff --git a/pkg/cli/codemod_slash_command_test.go b/pkg/cli/codemod_slash_command_test.go index 31546b0bd15..196fe59057e 100644 --- a/pkg/cli/codemod_slash_command_test.go +++ b/pkg/cli/codemod_slash_command_test.go @@ -13,7 +13,7 @@ func TestGetCommandToSlashCommandCodemod(t *testing.T) { codemod := getCommandToSlashCommandCodemod() assert.Equal(t, "command-to-slash-command-migration", codemod.ID) - assert.Equal(t, "Migrate on.command to on.slash_command", codemod.Name) + assert.Equal(t, "Migrate on.command to on.slash-command", codemod.Name) assert.NotEmpty(t, codemod.Description) assert.Equal(t, "0.2.0", codemod.IntroducedIn) require.NotNil(t, codemod.Apply) diff --git a/pkg/cli/fix_command_test.go b/pkg/cli/fix_command_test.go index 18d55d58406..a39ec82ff27 100644 --- a/pkg/cli/fix_command_test.go +++ b/pkg/cli/fix_command_test.go @@ -557,7 +557,7 @@ func TestFixCommand_CommandToSlashCommandMigration(t *testing.T) { tmpDir := t.TempDir() workflowFile := filepath.Join(tmpDir, "test-workflow.md") - // Create a workflow with deprecated on.command field + // Create a workflow with deprecated on.slash-command field content := `--- on: command: my-bot diff --git a/pkg/workflow/frontmatter_extraction_yaml.go b/pkg/workflow/frontmatter_extraction_yaml.go index 630dc2a396a..69d6a86705e 100644 --- a/pkg/workflow/frontmatter_extraction_yaml.go +++ b/pkg/workflow/frontmatter_extraction_yaml.go @@ -222,7 +222,7 @@ func (c *Compiler) extractExpressionFromIfString(ifString string) string { func (c *Compiler) extractCommandConfig(frontmatter map[string]any) (commandNames []string, commandEvents []string, commandCentralized bool, commandPlaceholder string) { frontmatterLog.Print("Extracting command configuration from frontmatter") // Check new format: on.slash_command or on.slash_command.name (preferred) - // Also check legacy format: on.command or on.command.name (deprecated) + // Also check legacy format: on.slash-command or on.slash-command.name (deprecated) commandValue, hasCommand := extractOnTriggerValue(frontmatter, "slash_command") isDeprecated := false if !hasCommand { From 653f1d6dd5fe23049d646917733e60ea1199bf0f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:49:26 +0000 Subject: [PATCH 3/3] fix: correct slash-command (hyphen) to slash_command (underscore) across all files Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/check_command_position.cjs | 2 +- pkg/cli/codemod_slash_command.go | 10 +++++----- pkg/cli/codemod_slash_command_test.go | 2 +- pkg/cli/fix_command_test.go | 2 +- pkg/workflow/frontmatter_extraction_yaml.go | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actions/setup/js/check_command_position.cjs b/actions/setup/js/check_command_position.cjs index f8128b85f7e..2910b3285f0 100644 --- a/actions/setup/js/check_command_position.cjs +++ b/actions/setup/js/check_command_position.cjs @@ -136,7 +136,7 @@ async function main() { core.setOutput("matched_command", ""); await writeDenialSummary( `The trigger comment did not start with a required command. Expected one of: ${expectedCommands}. Found: \`${firstWord}\`.`, - "Make sure the trigger comment starts with the required command defined in `on.slash-command:` in the workflow frontmatter." + "Make sure the trigger comment starts with the required command defined in `on.slash_command:` in the workflow frontmatter." ); } } catch (error) { diff --git a/pkg/cli/codemod_slash_command.go b/pkg/cli/codemod_slash_command.go index 4df877006e4..0e3581237e6 100644 --- a/pkg/cli/codemod_slash_command.go +++ b/pkg/cli/codemod_slash_command.go @@ -8,12 +8,12 @@ import ( var slashCommandCodemodLog = logger.New("cli:codemod_slash_command") -// getCommandToSlashCommandCodemod creates a codemod for migrating on.command to on.slash-command +// getCommandToSlashCommandCodemod creates a codemod for migrating on.command to on.slash_command func getCommandToSlashCommandCodemod() Codemod { return Codemod{ ID: "command-to-slash-command-migration", - Name: "Migrate on.command to on.slash-command", - Description: "Replaces deprecated 'on.command' field with 'on.slash-command'", + Name: "Migrate on.command to on.slash_command", + Description: "Replaces deprecated 'on.command' field with 'on.slash_command'", IntroducedIn: "0.2.0", Apply: func(content string, frontmatter map[string]any) (string, bool, error) { // Check if on.command exists @@ -62,7 +62,7 @@ func getCommandToSlashCommandCodemod() Codemod { if didReplace { result[i] = replacedLine modified = true - slashCommandCodemodLog.Printf("Replaced on.command with on.slash-command on line %d", i+1) + slashCommandCodemodLog.Printf("Replaced on.command with on.slash_command on line %d", i+1) } else { result[i] = line } @@ -73,7 +73,7 @@ func getCommandToSlashCommandCodemod() Codemod { return result, modified }) if applied { - slashCommandCodemodLog.Print("Applied on.command to on.slash-command migration") + slashCommandCodemodLog.Print("Applied on.command to on.slash_command migration") } return newContent, applied, err }, diff --git a/pkg/cli/codemod_slash_command_test.go b/pkg/cli/codemod_slash_command_test.go index 196fe59057e..31546b0bd15 100644 --- a/pkg/cli/codemod_slash_command_test.go +++ b/pkg/cli/codemod_slash_command_test.go @@ -13,7 +13,7 @@ func TestGetCommandToSlashCommandCodemod(t *testing.T) { codemod := getCommandToSlashCommandCodemod() assert.Equal(t, "command-to-slash-command-migration", codemod.ID) - assert.Equal(t, "Migrate on.command to on.slash-command", codemod.Name) + assert.Equal(t, "Migrate on.command to on.slash_command", codemod.Name) assert.NotEmpty(t, codemod.Description) assert.Equal(t, "0.2.0", codemod.IntroducedIn) require.NotNil(t, codemod.Apply) diff --git a/pkg/cli/fix_command_test.go b/pkg/cli/fix_command_test.go index a39ec82ff27..18d55d58406 100644 --- a/pkg/cli/fix_command_test.go +++ b/pkg/cli/fix_command_test.go @@ -557,7 +557,7 @@ func TestFixCommand_CommandToSlashCommandMigration(t *testing.T) { tmpDir := t.TempDir() workflowFile := filepath.Join(tmpDir, "test-workflow.md") - // Create a workflow with deprecated on.slash-command field + // Create a workflow with deprecated on.command field content := `--- on: command: my-bot diff --git a/pkg/workflow/frontmatter_extraction_yaml.go b/pkg/workflow/frontmatter_extraction_yaml.go index 69d6a86705e..630dc2a396a 100644 --- a/pkg/workflow/frontmatter_extraction_yaml.go +++ b/pkg/workflow/frontmatter_extraction_yaml.go @@ -222,7 +222,7 @@ func (c *Compiler) extractExpressionFromIfString(ifString string) string { func (c *Compiler) extractCommandConfig(frontmatter map[string]any) (commandNames []string, commandEvents []string, commandCentralized bool, commandPlaceholder string) { frontmatterLog.Print("Extracting command configuration from frontmatter") // Check new format: on.slash_command or on.slash_command.name (preferred) - // Also check legacy format: on.slash-command or on.slash-command.name (deprecated) + // Also check legacy format: on.command or on.command.name (deprecated) commandValue, hasCommand := extractOnTriggerValue(frontmatter, "slash_command") isDeprecated := false if !hasCommand {