ShouldGeneratePRCheckoutStep returns true if the checkout-pr step should be generated based on the workflow permissions. The step requires contents read access.
(data *WorkflowData)
| 12 | // ShouldGeneratePRCheckoutStep returns true if the checkout-pr step should be generated |
| 13 | // based on the workflow permissions. The step requires contents read access. |
| 14 | func ShouldGeneratePRCheckoutStep(data *WorkflowData) bool { |
| 15 | if data.CachedPermissions != nil { |
| 16 | return data.CachedPermissions.HasContentsReadAccess() |
| 17 | } |
| 18 | permParser := NewPermissionsParser(data.Permissions) |
| 19 | return permParser.HasContentsReadAccess() |
| 20 | } |
| 21 | |
| 22 | // generateSaveBaseGitHubFoldersStep generates step strings (for the activation job) that |
| 23 | // snapshot agent config folders and root instruction files from the workspace into |