"Repository not found or permission denied" when creating AWS Codebuild Repository - aws-codebuild

We are trying to create a codebuild in aws and have a private github repository in github, while creating the codebuild section i am getting the Repository not found or permission denied error after clicking on create button in code build section.
has someone came across this issue, if so can you please suggest.
Thanks in Advance.

I had this issue because I was using a low-privilege account to access GitHub. CodeBuild needs admin access to the repository in order to create webhooks, so the solution for me was to grant the user admin access to the repo in question (via GitHub, in the repo's Settings page), create the CodeBuild project, then set the user back to read-only.

Try:
CodeBuild > {project} > Sources > Disconnect from GitHub, then Reconnect with a GitHub account where your code repository is.
CodeBuild can only hold one GitHub authentication per account per region.

Related

Automate DVC authentication when using github actions

I'm using GitHub Actions to run some tests on every push and I need DVC. I'm trying to make this work with the runs-on: ubuntu-latest option but when I try to run it, the action get's stuck because it requires manual authentication. Is there a way to go around this and automate the authentication ?
I figured out that in order for this to work, I had to switch to using a service account.
I had the same issue. Here are the steps I used to setup a Google Service Account with DVC, Google Drive and Github Actions.
Setup a google cloud platform service account
A google cloud platform service account "is a special kind of account used by an application or compute workload, such as a Compute Engine virtual machine (VM) instance, rather than a person. A service account is identified by its email address, which is unique to the account." In this case, the service account for your app to access Google Drive.
Go to the Google API Console
Select or Create a project for DVC remote connections.
Enable the Google Drive API by clicking the ENABLE button
Go to the Google API Crediential page
Click on the + Create Credentials button and then select Service Account.
Enter a service account name (such as gdrive-api) and a some description (such as "Allows access to the google drive api") then click on the Create and continue button.
Click continue at the "Grant this service account access to the project (optional)" section: No need to add any accesses.
Click Done at the "Grant users access to this service account (optional)". Again, no need to grant any additional accesses.
Go to Service Accounts. You'll see a list of all service accounts for the your GCP project and click on the service account you just created.
Click on key --> add key --> Create new key and
In the popup window that appears, select JSON as key type, click the Create button. A JSON file of the key you created will download.
Share access to the Google Drive folder where the DVC repo will live
Still on Google Cloud Platform,
Go in IAM --> Service Accounts and click on the service account name you created in the previous section
Copy and paste the email associated to this service account. It should have a form service_account_name#project_id.iam.gserviceaccount.com
Move to Google Drive and share the drive folder where the DVC repo will live with the service account email defined in the last step.
Set DVC config to use a google service account
On your local machine, modify the DVC project config file by typing the following commands. Change my_remote with your actual DVC remote name.
dvc remote add --default my_remote gdrive://your_folder_hash
dvc remote modify my_remote gdrive_use_service_account true
dvc remote modify my_remote --local gdrive_service_account_json_file_path path/to/file.json
This will modify the .dvc/config and .dvc/config.local files in your project.
Run the command dvc push. If you see no error message, you are done with this step.
Push your code to origin on Github
Setup a Repository Secret
In your Github repo, go to Settings -> Secrets and Variables -> Actions
Click on the New repository secret button.
Name the secret to whatever is meaningful to you.
Copy and paste the JSON file content you downloaded in the previous section to the Secret* text box.
Click the Add Secret button
Setup a Github action
To your Github action yaml file, add the following (make sure to change the YOUR_REPO_SECRET_NAME to the name of the repo secret you created in the previous step.
- uses: iterative/setup-dvc#v1
- name: Pull data with DVC
env:
GDRIVE_CREDENTIALS_DATA: ${{ secrets.YOUR_REPO_SECRET_NAME }}
run: |
dvc pull
Commit this change and run the Github action!
References
How to Setup a Google Drive DVC Remote

Cypress CI integration with GitHub

Can someone help if I understand why I can't connect cypress with Github? I get this 422 error message whenever I request access to connect cypress to Github.
There can be multiple reasons for the above 422 error(permission error) that you get while accessing github from cypress:
you do not have access to the github repo you are trying to access, check with your Github admin
if you have a particular Team(Dev/QA/DevOps/PM etc) access to github account of your org, check with your Github admin to see if above repository has been added to your Team for access.

Set permissions for different namespaces in Azure DevOps using Rest API

How can I use RestAPI to set permissions for Build definitions, Release definitions, git repo and team securities? When I was using TFS, I was able to do this using Tfsssecurity.exe tool.
Edited.
For example, I am trying to modify the project permissions of Contributors group. like Allow Contributors to rename team project etc.
enter image description here
Are you looking for the Security API page?
You probably need to manage group membership using Graph API.
The Get started page lists the libraries you can use and how to authenticate.
There isn’t the REST API to change permission of release definition and git repo. Other contributors submit a user voice that you can vote Set version control permissions by REST API
For details,please refer to these links:
VSTS REST API to change security permissions on Release definition or Release definition environment
Use VSTS Rest API to set git repo permissions
Hope this helps.

Auth problem with creating Cloud Build Triggers

I seem to have gotten my Google/Github authentication into some kind of bad state. I am attempting (repeatedly) to create a Github build trigger by the following steps:
From https://console.cloud.google.com/cloud-build/triggers click
"Create trigger"
Select Github and check the consent box.
Sign in to my Github account. This succeeds and I see the list of my repositories and my organization's repositories.
No matter what repository I select, I see this error:
There's a problem at our end
I've tried include signing out and in of my Github and Google accounts (including clearing all cookies) but nothing helps. I also asked another administrator to create the trigger and he sees the same error, which implies the issue must relate somehow between Google and Github and isn't specific to my personal account?
If anyone has seen this before or has any suggestions it would be a big help. Thanks!

Is there a GitHub API scope that links to a single repository?

I'm writing an application that links to a user's github account. It will push some files to their github account. I only need access to a single repo (of their choosing), but from the github docs it seems that there's only:
read/write access to all public repos
read/write access to all repos (public AND private)
No way to lock down auth to a single repo, is that correct? I mostly wanted to do this for the user's peace of mind, rather than any requirements at my end (from my app I can get them to select which repo to push to).
Source: Github oauth docs