Thank you for your question on how to dynamically update your project using Codebuild with multiple GitHub Repositories.
I have replicated your use case in my own environment using AWS CodePipeline and configured it using two GitHub repositories as sources which dynamically triggered Codebuild. Below are the steps I took.
Currently this feature update your Build Project using CodeBuild with multiple GitHub resources to automatically trigger CodeBuild isn't an available feature that CodeBuild provides. However Integrating your CodeBuild project into CodePipeline with fix this problem.
Here you can find how CodePipeline integrates with CodeBuild to use multiple input sources as outlined in your use case  .
First create two separate GitHub repositories in an account with different source code in each.
Then configure a CodeBuild project with a name and a buildspec that outputs the source code in a giving directory .
Next continue to the CodePipeline Console and create a pipeline . Configure the source page and select GitHub as the source provider, which prompted a sign in, in order to authorize application access to the account. When the account is authorized this may you chose your GitHub repository for the source location for your pipeline, along with the branch . 
Then configure the Build section , you should chose CodeBuild and from here chose the Build Project you created in step 2.
You should chose to skip the deploy stage, as this step was is necessary for the pipeline.
When the build is complete, you can edit the source section of the Pipeline, to add a “new stage”. Here you will prompted to sign into GitHub. When authorized choose add source and pick the second repository you've created and save.
When commits are made to either of the GitHub repositories they will automatically trigger the Pipeline which your CodeBuild project is associated to.
Please feel free to reach out to me with any questions or concerns .
Use same CodeBuild project for multiple GitHub repositoriesAccepted Answerasked a year ago
Does CodeBuild support fetching from private GitHub repository?asked 3 years ago
Can I connect a Sagemaker "Studio" instance to a private github repository?asked 5 months ago
CodeGuru not loading the list of private GitHub repositoriesAccepted Answerasked a year ago
How to feed seed code to GitHub Repository from Sagemaker Projects Organization Template created with Service Catalog?Accepted Answerasked 5 months ago
How to query Codebuild/Cloudwatch Logs from Buildspec.yml in CodeBuildasked 4 months ago
Error creating CodeBuild project - CodeBuild is not authorized to perform...Accepted Answerasked 6 months ago
Pass CommitId of a CodeCommit tag to CodeBuild projectasked 4 years ago
CodePipeline - how to pass and consume multiple artifacts across CodeBuild Steps?asked 10 months ago
CodeStar CLI - Create CodeStar Project without creating GitHub Repoasked 4 years ago