@@ -62,9 +62,11 @@ func (m ActionMode) UsesExternalActions() bool {
6262}
6363
6464// DetectActionMode determines the appropriate action mode based on the release flag.
65- // Returns ActionModeRelease if this binary was built as a release (controlled by the
66- // isReleaseBuild flag set via -X linker flag at build time), otherwise returns ActionModeDev.
67- // Can be overridden with GH_AW_ACTION_MODE environment variable or GitHub Actions context.
65+ // Returns ActionModeAction if this binary was built as a release (controlled by the
66+ // isReleaseBuild flag set via -X linker flag at build time), or when running in a
67+ // GitHub Actions release context (release tags, release branches, or release events).
68+ // Returns ActionModeDev for all other cases (PRs, feature branches, local development).
69+ // Can be overridden with GH_AW_ACTION_MODE environment variable.
6870// The version parameter is kept for backward compatibility but is no longer used for detection.
6971func DetectActionMode (version string ) ActionMode {
7072 actionModeLog .Printf ("Detecting action mode: version=%s, isRelease=%v" , version , IsRelease ())
@@ -82,24 +84,24 @@ func DetectActionMode(version string) ActionMode {
8284 // Check if this binary was built as a release using the release flag
8385 // This flag is set at build time via -X linker flag and does not rely on version string heuristics
8486 if IsRelease () {
85- actionModeLog .Printf ("Detected release mode from build flag (isReleaseBuild=true)" )
86- return ActionModeRelease
87+ actionModeLog .Printf ("Detected action mode from build flag (isReleaseBuild=true)" )
88+ return ActionModeAction
8789 }
8890
8991 // Check GitHub Actions context for additional hints
9092 githubRef := os .Getenv ("GITHUB_REF" )
9193 githubEventName := os .Getenv ("GITHUB_EVENT_NAME" )
9294 actionModeLog .Printf ("GitHub context: ref=%s, event=%s" , githubRef , githubEventName )
9395
94- // Release mode conditions from GitHub Actions context:
96+ // Conditions that return ActionModeAction from GitHub Actions context:
9597 // 1. Running on a release branch (refs/heads/release*)
9698 // 2. Running on a release tag (refs/tags/*)
9799 // 3. Running on a release event
98100 if strings .HasPrefix (githubRef , "refs/heads/release" ) ||
99101 strings .HasPrefix (githubRef , "refs/tags/" ) ||
100102 githubEventName == "release" {
101- actionModeLog .Printf ("Detected release mode from GitHub context: ref=%s, event=%s" , githubRef , githubEventName )
102- return ActionModeRelease
103+ actionModeLog .Printf ("Detected action mode from GitHub context: ref=%s, event=%s" , githubRef , githubEventName )
104+ return ActionModeAction
103105 }
104106
105107 // Default to dev mode for all other cases:
0 commit comments