(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func TestResolveActionReference(t *testing.T) { |
| 116 | tests := []struct { |
| 117 | name string |
| 118 | actionMode ActionMode |
| 119 | localPath string |
| 120 | version string |
| 121 | actionTag string |
| 122 | expectedRef string |
| 123 | shouldBeEmpty bool |
| 124 | description string |
| 125 | }{ |
| 126 | { |
| 127 | name: "dev mode", |
| 128 | actionMode: ActionModeDev, |
| 129 | localPath: "./actions/create-issue", |
| 130 | version: "v1.0.0", |
| 131 | expectedRef: "./actions/create-issue", |
| 132 | description: "Dev mode should return local path", |
| 133 | }, |
| 134 | { |
| 135 | name: "release mode with version tag and unresolved pin", |
| 136 | actionMode: ActionModeRelease, |
| 137 | localPath: "./actions/create-issue", |
| 138 | version: "v1.0.0", |
| 139 | shouldBeEmpty: true, |
| 140 | description: "Release mode should fail closed when action cannot be pinned", |
| 141 | }, |
| 142 | { |
| 143 | name: "release mode with dev version", |
| 144 | actionMode: ActionModeRelease, |
| 145 | localPath: "./actions/create-issue", |
| 146 | version: "dev", |
| 147 | shouldBeEmpty: true, |
| 148 | description: "Release mode with 'dev' version should return empty", |
| 149 | }, |
| 150 | { |
| 151 | name: "release mode with action-tag overrides version", |
| 152 | actionMode: ActionModeRelease, |
| 153 | localPath: "./actions/setup", |
| 154 | version: "v1.0.0", |
| 155 | actionTag: "latest", |
| 156 | expectedRef: "github/gh-aw-actions/setup@latest", |
| 157 | description: "Frontmatter action-tag should use action mode (gh-aw-actions) regardless of compiler mode", |
| 158 | }, |
| 159 | { |
| 160 | name: "release mode with action-tag using SHA", |
| 161 | actionMode: ActionModeRelease, |
| 162 | localPath: "./actions/setup", |
| 163 | version: "v1.0.0", |
| 164 | actionTag: "abc123def456789", |
| 165 | expectedRef: "github/gh-aw-actions/setup@abc123def456789", |
| 166 | description: "Frontmatter action-tag SHA should use action mode (gh-aw-actions)", |
| 167 | }, |
| 168 | { |
| 169 | name: "dev mode with action-tag uses external actions repo", |
| 170 | actionMode: ActionModeDev, |
| 171 | localPath: "./actions/setup", |
| 172 | version: "v1.0.0", |
nothing calls this directly
no test coverage detected