I have a Github actions workflow that consists of two dependent jobs:
Now I want to use AWS CodeBuild to run as a self hosted runner for GitHub actions (so I can run everything in my VPC).
While this basically works, for each job, the code gets checked out to a different folder.
Job A return this folder for the target path to a changed module /codebuild/output/src1067370363/src/actions-runner/_work/myorg/myrepo/packages/module-a
But in Job B the source code ist checked out to /codebuild/output/src1107479956/src/actions-runner/_work/myorg/myrepo
Therefore all CI commands fail since the directory does not exist.
Is it possible in CodeBuild to change the directory?
The source path changes every build, but you can use the CODEBUILD_SRC_DIR
environment variable to get the relative path. In self hosted runner builds, the value looks like /codebuild/output/src3071359377/src
. You can check more detailed information on CodeBuild environment variables here.