It doesn't look like you can just pull down a certain folder but the artifact for the build spec you can specify the directories that are used for the build.
For GitHub, for the optional Source version value, type a commit ID, a pull request ID, a branch name, or a tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID will be used. If Source version is blank, the default branch's HEAD commit ID will be used.
http://docs.aws.amazon.com/codebuild/latest/userguide/run-build.html
artifacts Optional sequence. Represents information about where AWS CodeBuild can find the build output and how AWS CodeBuild will prepare it for uploading to the Amazon S3 output bucket. This sequence is not required if, for example, you are building and pushing a Docker image to Amazon ECR, or you are running unit tests on your source code but not building it.
files: Required sequence. Represents the locations containing the build output artifacts in the build environment. Contains a sequence of scalars, with each scalar representing a separate location where AWS CodeBuild can find build output artifacts, relative to the original build location. Locations can include the following:
A single file (for example, my-file.jar).
A single file in a subdirectory (for example, my-subdirectory/my-file.jar or my-parent-subdirectory/my-subdirectory/my-file.jar).
'/' represents all files recursively.
my-subdirectory/ represents all files in a subdirectory named my-subdirectory.
my-subdirectory//* represents all files recursively starting from a subdirectory named my-subdirectory.
http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html