public IActionResult Create([FromRoute] Guid project_id, [FromRoute] Guid sprint_id, [FromBody] WorkflowCreateM model) { try { JwtClaimM jwt_claim = _jwtAuth.GetClaims(Request); _permission.EnsureProjectMember(jwt_claim.UserId, project_id); _sprint.EnsureExisted(project_id, sprint_id); _projectRepository.EnsureExist(project_id, model.RepositoryId); _account.EnsureOwner(jwt_claim.UserId, model.AccountId); IList <BranchM> branches = _branch.GetAll(model.RepositoryId, model.BranchIds); string path = _sprint.GetConfigurationFilePath(sprint_id); GHRepositoryRequirement gh_repo = _repository.GetGHRepositoryRequirement(model.AccountId, model.RepositoryId); foreach (var config in model.Configs) { if (config.ConfigTool.Equals(ConfigTool.CircleCI)) { config.Content = _circleCIConfiguration.CreateConfigurationContent(config.Content); } } _gHContent.CreateConfigurationFiles(gh_repo.GHUser.Name, gh_repo.RepositoryName, gh_repo.GHUser.AccessToken, branches, path, model.Configs, sprint_id); return(Ok(model.Configs)); } catch (Exception e) { return(GetError(e)); } }