(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestGetEffectiveSafeOutputGitHubToken(t *testing.T) { |
| 38 | tests := []struct { |
| 39 | name string |
| 40 | customToken string |
| 41 | expected string |
| 42 | }{ |
| 43 | { |
| 44 | name: "custom token has highest precedence", |
| 45 | customToken: "${{ secrets.CUSTOM_TOKEN }}", |
| 46 | expected: "${{ secrets.CUSTOM_TOKEN }}", |
| 47 | }, |
| 48 | { |
| 49 | name: "default fallback includes GH_AW_GITHUB_TOKEN (safe outputs chain)", |
| 50 | customToken: "", |
| 51 | expected: "${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}", |
| 52 | }, |
| 53 | } |
| 54 | |
| 55 | for _, tt := range tests { |
| 56 | t.Run(tt.name, func(t *testing.T) { |
| 57 | result := getEffectiveSafeOutputGitHubToken(tt.customToken) |
| 58 | if result != tt.expected { |
| 59 | t.Errorf("getEffectiveSafeOutputGitHubToken() = %q, want %q", result, tt.expected) |
| 60 | } |
| 61 | }) |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func TestGetEffectiveCopilotGitHubToken(t *testing.T) { |
| 66 | tests := []struct { |
nothing calls this directly
no test coverage detected