Write Terraform code that configures the GitHub repository according to the following requirements, execute it and save your Terraform code in a repository secret named TERRAFORM.
-
The GitHub repository should assign user
softservedataas a collaborator. -
A branch named
developshould be created as default branch. -
Protect the
mainanddevelopbranches according to these rules:
- a user cannot merge into both branches without a pull request
- merging into the
developbranch is allowed only if there are two approvals - merging into the
mainbranch is allowed only if the owner has approved the pull request - assign the user
softservedataas the code owner for all the files in themainbranch
- A pull request template (pull_request_template.md) should be added to the
.githubdirectory to allow users to create an issue in the required format:
- I have performed a self-review of my code
- If it is a core feature, I have added thorough tests
- Do we need to implement analytics?
- Will this be part of a product update? If yes, please write one phrase about this update
-
A deploy key named
DEPLOY_KEYshould be added to the repository. -
Create a Discord server and enable notifications when a pull request is created.
-
For GitHub actions, perform the following:
- create PAT (Personal Access Token) with Full control of private repositories and Full control of orgs and teams, read and write org projects
- add the PAT to the repository actions secrets key with the name
PATand the value of the created PAT.