(token string)
| 27 | See acceptance/README.md#script-metadata for details.` |
| 28 | |
| 29 | func tokenHasUserCapability(token string) (bool, error) { |
| 30 | switch { |
| 31 | case strings.HasPrefix(token, "ghp_"), |
| 32 | strings.HasPrefix(token, "gho_"), |
| 33 | strings.HasPrefix(token, "github_pat_"), |
| 34 | strings.HasPrefix(token, "ghu_"): |
| 35 | return true, nil |
| 36 | case strings.HasPrefix(token, "ghs_"): |
| 37 | return false, nil |
| 38 | default: |
| 39 | return false, fmt.Errorf("GH_ACCEPTANCE_TOKEN has an unsupported token prefix") |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | func requiresUserCapabilityForScript(file string) (bool, error) { |
| 44 | f, err := os.Open(file) |
no test coverage detected